pub struct TopicMetadataAndConfig { /* private fields */ }Expand description
Topic metadata and configuration returned per created topic.
Carries either the metadata or a stored error; the accessors return the stored error.
Implementations§
Source§impl TopicMetadataAndConfig
impl TopicMetadataAndConfig
Sourcepub fn new(
topic_id: Uuid,
num_partitions: i32,
replication_factor: i32,
config: Config,
) -> Self
pub fn new( topic_id: Uuid, num_partitions: i32, replication_factor: i32, config: Config, ) -> Self
Creates a successful metadata-and-config holder.
§Arguments
topic_id- the topic id.num_partitions- the number of partitions of the topic.replication_factor- the replication factor of the topic.config- the topic config.
Sourcepub fn with_error(error: Error) -> Self
pub fn with_error(error: Error) -> Self
Creates a holder representing a failure; every accessor returns the error.
§Arguments
error- the error every accessor returns.
Sourcepub fn topic_id(&self) -> Result<Uuid, Error>
pub fn topic_id(&self) -> Result<Uuid, Error>
Returns the topic id, or the stored error.
§Errors
The error the topic creation failed with, if any.
Sourcepub fn num_partitions(&self) -> Result<i32, Error>
pub fn num_partitions(&self) -> Result<i32, Error>
Returns the number of partitions, or the stored error.
§Errors
The error the topic creation failed with, if any.
Trait Implementations§
Source§impl Clone for TopicMetadataAndConfig
impl Clone for TopicMetadataAndConfig
Source§fn clone(&self) -> TopicMetadataAndConfig
fn clone(&self) -> TopicMetadataAndConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TopicMetadataAndConfig
impl RefUnwindSafe for TopicMetadataAndConfig
impl Send for TopicMetadataAndConfig
impl Sync for TopicMetadataAndConfig
impl Unpin for TopicMetadataAndConfig
impl UnsafeUnpin for TopicMetadataAndConfig
impl UnwindSafe for TopicMetadataAndConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more