pub struct Subject { /* private fields */ }Expand description
A concrete, hierarchical, dot-separated routing key.
Example: vehicle.sensors.imu.gyro. Subjects are case-sensitive,
have no leading/trailing/consecutive separators, and never contain
wildcards (+/# — see SubjectPattern).
Implementations§
Source§impl Subject
impl Subject
Sourcepub fn from_segments(
segments: Vec<SubjectSegment>,
) -> Result<Self, SubjectError>
pub fn from_segments( segments: Vec<SubjectSegment>, ) -> Result<Self, SubjectError>
Sourcepub fn from_str(s: &str) -> Result<Self, SubjectError>
pub fn from_str(s: &str) -> Result<Self, SubjectError>
Parse a Subject from a dot-joined string.
§Errors
Returns a SubjectError variant for any grammar violation
(empty segment, invalid charset, leading/trailing/consecutive
separator, wildcard in concrete subject, empty subject).
Sourcepub fn segments(&self) -> &[SubjectSegment]
pub fn segments(&self) -> &[SubjectSegment]
The segments of this subject.
Sourcepub fn is_concrete(&self) -> bool
pub fn is_concrete(&self) -> bool
Always true for Subject (only patterns can be non-concrete).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subject
impl<'de> Deserialize<'de> for Subject
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Subject
impl StructuralPartialEq for Subject
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnsafeUnpin for Subject
impl UnwindSafe for Subject
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