pub struct SourcePathSegment {
pub key: SourceKey,
pub array: Option<Option<usize>>,
}Expand description
A segment in a source path.
Fields§
§key: SourceKeyThe key part of the segment
array: Option<Option<usize>>Optional array marker:
None= no markerSome(None)=[](push to array)Some(Some(n))=[n](index into array)
Implementations§
Source§impl SourcePathSegment
impl SourcePathSegment
Sourcepub fn ident(name: Identifier) -> Self
pub fn ident(name: Identifier) -> Self
Create a simple identifier segment without array marker.
Sourcepub fn extension(name: Identifier) -> Self
pub fn extension(name: Identifier) -> Self
Create an extension segment without array marker.
Sourcepub fn with_array_push(self) -> Self
pub fn with_array_push(self) -> Self
Create a segment with array push marker ([]).
Sourcepub fn with_array_index(self, index: usize) -> Self
pub fn with_array_index(self, index: usize) -> Self
Create a segment with array index marker ([n]).
Trait Implementations§
Source§impl Clone for SourcePathSegment
impl Clone for SourcePathSegment
Source§fn clone(&self) -> SourcePathSegment
fn clone(&self) -> SourcePathSegment
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 moreSource§impl Debug for SourcePathSegment
impl Debug for SourcePathSegment
Source§impl PartialEq for SourcePathSegment
impl PartialEq for SourcePathSegment
impl Eq for SourcePathSegment
impl StructuralPartialEq for SourcePathSegment
Auto Trait Implementations§
impl Freeze for SourcePathSegment
impl RefUnwindSafe for SourcePathSegment
impl Send for SourcePathSegment
impl Sync for SourcePathSegment
impl Unpin for SourcePathSegment
impl UnwindSafe for SourcePathSegment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.