pub struct CodecTypePath { /* private fields */ }Expand description
One type path a rendered expression names.
§Bounds
The segments are structurally non-empty: a path naming no segment names nothing, and a rendering that wrote one would emit a bare separator.
Implementations§
Source§impl CodecTypePath
impl CodecTypePath
Sourcepub fn spelled(
rooting: PathRooting,
segments: Vec<String>,
) -> Result<Self, CodecError>
pub fn spelled( rooting: PathRooting, segments: Vec<String>, ) -> Result<Self, CodecError>
One type path, rooted as the caller stated and spelled from the segments it named.
§Errors
Returns CodecIssue::SegmentNotAnIdentifier where a segment cannot name a rendered item — the root is typed as the rooting, so every segment is an item step, refused outside the alphabet or on the keyword roster — CodecIssue::PathSegmentsAbsent where no segment was supplied, and CodecIssue::PathSegmentsUnbounded where the segments outgrow the declared magnitude.
The checks are dependent and in that order, so exactly one cause is true of any refused path.
Sourcepub const fn rooting(&self) -> PathRooting
pub const fn rooting(&self) -> PathRooting
Where this path is rooted.
Trait Implementations§
Source§impl Clone for CodecTypePath
impl Clone for CodecTypePath
Source§fn clone(&self) -> CodecTypePath
fn clone(&self) -> CodecTypePath
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 CodecTypePath
impl Debug for CodecTypePath
impl Eq for CodecTypePath
Source§impl Hash for CodecTypePath
impl Hash for CodecTypePath
Source§impl PartialEq for CodecTypePath
impl PartialEq for CodecTypePath
impl StructuralPartialEq for CodecTypePath
Auto Trait Implementations§
impl Freeze for CodecTypePath
impl RefUnwindSafe for CodecTypePath
impl Send for CodecTypePath
impl Sync for CodecTypePath
impl Unpin for CodecTypePath
impl UnsafeUnpin for CodecTypePath
impl UnwindSafe for CodecTypePath
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