pub struct LocatorSegment {
pub label: LocatorType,
pub value: LocatorValue,
}Expand description
A single segment of a compound locator.
Pairs a locator type with its value, e.g. { label: chapter, value: "3" }.
Fields§
§label: LocatorTypeThe locator type for this segment.
value: LocatorValueThe locator value (e.g., “3”, “42-45”).
Implementations§
Source§impl LocatorSegment
impl LocatorSegment
Sourcepub fn new(label: LocatorType, value: impl Into<LocatorValue>) -> Self
pub fn new(label: LocatorType, value: impl Into<LocatorValue>) -> Self
Create a locator segment from a canonical label and value.
Trait Implementations§
Source§impl Clone for LocatorSegment
impl Clone for LocatorSegment
Source§fn clone(&self) -> LocatorSegment
fn clone(&self) -> LocatorSegment
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 LocatorSegment
impl Debug for LocatorSegment
Source§impl<'de> Deserialize<'de> for LocatorSegment
impl<'de> Deserialize<'de> for LocatorSegment
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
Source§impl PartialEq for LocatorSegment
impl PartialEq for LocatorSegment
Source§fn eq(&self, other: &LocatorSegment) -> bool
fn eq(&self, other: &LocatorSegment) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LocatorSegment
impl Serialize for LocatorSegment
impl StructuralPartialEq for LocatorSegment
Auto Trait Implementations§
impl Freeze for LocatorSegment
impl RefUnwindSafe for LocatorSegment
impl Send for LocatorSegment
impl Sync for LocatorSegment
impl Unpin for LocatorSegment
impl UnsafeUnpin for LocatorSegment
impl UnwindSafe for LocatorSegment
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