pub struct PulsarTopic { /* private fields */ }Expand description
A validated Pulsar topic name.
§Examples
use ruststream_pulsar::PulsarTopic;
let topic = PulsarTopic::persistent("acme", "orders", "created");
assert_eq!(topic.as_str(), "persistent://acme/orders/created");
let parsed = PulsarTopic::parse("persistent://acme/orders/created")?;
assert_eq!(parsed, topic);Implementations§
Source§impl PulsarTopic
impl PulsarTopic
Sourcepub fn persistent(tenant: &str, namespace: &str, topic: &str) -> Self
pub fn persistent(tenant: &str, namespace: &str, topic: &str) -> Self
Sourcepub fn non_persistent(tenant: &str, namespace: &str, topic: &str) -> Self
pub fn non_persistent(tenant: &str, namespace: &str, topic: &str) -> Self
Sourcepub fn parse(name: &str) -> Result<Self, PulsarError>
pub fn parse(name: &str) -> Result<Self, PulsarError>
Parses a fully qualified name (persistent://t/ns/topic), a tenant/namespace/topic
triple (defaulting to persistent), or a bare topic name (defaulting to
persistent://public/default/).
§Errors
Returns PulsarError::Invalid when the shape or a component is invalid.
Trait Implementations§
Source§impl Clone for PulsarTopic
impl Clone for PulsarTopic
Source§fn clone(&self) -> PulsarTopic
fn clone(&self) -> PulsarTopic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PulsarTopic
impl Debug for PulsarTopic
Source§impl Display for PulsarTopic
impl Display for PulsarTopic
impl Eq for PulsarTopic
Source§impl Hash for PulsarTopic
impl Hash for PulsarTopic
Source§impl PartialEq for PulsarTopic
impl PartialEq for PulsarTopic
impl StructuralPartialEq for PulsarTopic
Auto Trait Implementations§
impl Freeze for PulsarTopic
impl RefUnwindSafe for PulsarTopic
impl Send for PulsarTopic
impl Sync for PulsarTopic
impl Unpin for PulsarTopic
impl UnsafeUnpin for PulsarTopic
impl UnwindSafe for PulsarTopic
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