pub struct Path(/* private fields */);
Expand description
A path is a non empty list of identifiers that forms a namespace + type
Implementations§
Source§impl Path
impl Path
Sourcepub fn new(
basename: Id,
namespace: impl IntoIterator<Item = Id>,
loc: Loc,
) -> Self
pub fn new( basename: Id, namespace: impl IntoIterator<Item = Id>, loc: Loc, ) -> Self
Create Path
with a head and an iterator. Most significant name first.
Sourcepub fn iter(&self) -> impl Iterator<Item = &Id>
pub fn iter(&self) -> impl Iterator<Item = &Id>
Borrowed iteration of the Path
’s elements. Most significant name first
Sourcepub fn into_iter(self) -> impl Iterator<Item = Node<Id>>
pub fn into_iter(self) -> impl Iterator<Item = Node<Id>>
Consume the Path
and get an owned iterator over the elements. Most significant name first
Sourcepub fn split_last(self) -> (Vec<Id>, Id)
pub fn split_last(self) -> (Vec<Id>, Id)
Get the base type name as well as the (potentially empty) prefix
Sourcepub fn is_in_cedar(&self) -> bool
pub fn is_in_cedar(&self) -> bool
Is this referring to a name in the __cedar
namespace (eg: __cedar::Bool
)
Trait Implementations§
Source§impl From<Path> for InternalName
impl From<Path> for InternalName
impl Eq for Path
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more