pub struct TopicMetadataAndConfig { /* private fields */ }Expand description
Topic metadata and configuration returned per created topic.
Corresponds to CreateTopicsResult.TopicMetadataAndConfig. Carries either
the metadata or a stored error; the accessors surface the error (mirroring
Java’s ensureSuccess, which rethrows the stored ApiException).
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.
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.
Sourcepub fn num_partitions(&self) -> Result<i32, Error>
pub fn num_partitions(&self) -> Result<i32, Error>
The number of partitions, or the stored error.
Sourcepub fn replication_factor(&self) -> Result<i32, Error>
pub fn replication_factor(&self) -> Result<i32, Error>
The replication factor, or the stored error.
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