pub struct Id(/* private fields */);
Expand description
Identifiers. Anything in Id
should be a valid identifier, this means it
does not contain, for instance, spaces or characters like ‘+’; and also is
not one of the Cedar reserved identifiers (at time of writing,
true | false | if | then | else | in | is | like | has
).
Implementations§
Source§impl Id
impl Id
Sourcepub fn into_smolstr(self) -> SmolStr
pub fn into_smolstr(self) -> SmolStr
Get the underlying string
Sourcepub fn is_reserved(&self) -> bool
pub fn is_reserved(&self) -> bool
Return if the Id
is reserved (i.e., __cedar
)
Note that it does not test if the Id
string is a reserved keyword
as the parser already ensures that it is not
Trait Implementations§
Source§impl AsRef<Id> for UnreservedId
impl AsRef<Id> for UnreservedId
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
Deserialize an Id
using from_normalized_str
.
This deserialization implementation is used in the JSON schema format.
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 From<Id> for InternalName
impl From<Id> for InternalName
A shortcut for InternalName::unqualified_name
Source§impl From<UnreservedId> for Id
impl From<UnreservedId> for Id
Source§fn from(value: UnreservedId) -> Self
fn from(value: UnreservedId) -> Self
Converts to this type from the input type.
Source§impl FromNormalizedStr for Id
impl FromNormalizedStr for Id
Source§fn describe_self() -> &'static str
fn describe_self() -> &'static str
Short string description of the
Self
type, to be used in error messages.
What are we trying to parse?Source§fn from_normalized_str(s: &str) -> Result<Self, ParseErrors>
fn from_normalized_str(s: &str) -> Result<Self, ParseErrors>
Create a
Self
by parsing a string, which is required to be normalized.
That is, the input is required to roundtrip with the Display
impl on Self
:
Self::from_normalized_str(x).to_string() == x
must hold. Read moreSource§impl Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd for Id
Source§impl TryFrom<Id> for UnreservedId
impl TryFrom<Id> for UnreservedId
Source§impl TryFrom<InternalName> for Id
impl TryFrom<InternalName> for Id
Convert a InternalName
to an Id
The error type is the unit type because the reason the conversion fails
is obvious
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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<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