pub struct ActionEntityUID<N> {
pub id: SmolStr,
pub ty: Option<N>,
}Expand description
Represents the crate::ast::EntityUID of an action
Fields§
§id: SmolStrRepresents the crate::ast::Eid of the action
ty: Option<N>Represents the type of the action.
None is shorthand for Action.
If this is Some, the last component of the N should be Action.
INVARIANT: This can only be None in the N = RawName case.
This invariant is upheld by all the code below that constructs
ActionEntityUID.
We also rely on ActionEntityUID<N> only being Deserialize for
N = RawName, so that you can’t create an ActionEntityUID that
violates this invariant via deserialization.
Implementations§
Source§impl ActionEntityUID<RawName>
impl ActionEntityUID<RawName>
Sourcepub fn new(ty: Option<RawName>, id: SmolStr) -> Self
pub fn new(ty: Option<RawName>, id: SmolStr) -> Self
Create a new ActionEntityUID<RawName>.
ty = None is shorthand for Action.
Sourcepub fn default_type(id: SmolStr) -> Self
pub fn default_type(id: SmolStr) -> Self
Given an id, get the ActionEntityUID representing Action::<id>.
Source§impl ActionEntityUID<RawName>
impl ActionEntityUID<RawName>
Sourcepub fn conditionally_qualify_type_references(
self,
ns: Option<&InternalName>,
) -> ActionEntityUID<ConditionalName>
pub fn conditionally_qualify_type_references( self, ns: Option<&InternalName>, ) -> ActionEntityUID<ConditionalName>
(Conditionally) prefix this action entity UID’s typename with the given namespace
Sourcepub fn qualify_with(
self,
ns: Option<&InternalName>,
) -> ActionEntityUID<InternalName>
pub fn qualify_with( self, ns: Option<&InternalName>, ) -> ActionEntityUID<InternalName>
Unconditionally prefix this action entity UID’s typename with the given namespace
Source§impl ActionEntityUID<ConditionalName>
impl ActionEntityUID<ConditionalName>
Sourcepub fn ty(&self) -> &ConditionalName
pub fn ty(&self) -> &ConditionalName
Get the action type, as a ConditionalName.
Sourcepub fn fully_qualify_type_references(
self,
all_defs: &AllDefs,
) -> Result<ActionEntityUID<InternalName>, ActionNotDefinedError>
pub fn fully_qualify_type_references( self, all_defs: &AllDefs, ) -> Result<ActionEntityUID<InternalName>, ActionNotDefinedError>
Convert this ActionEntityUID<ConditionalName> into an
ActionEntityUID<InternalName> by fully-qualifying its typename.
all_defs needs to contain the full set of all fully-qualified typenames
and actions that are defined in the schema (in all schema fragments).
This ActionEntityUID<ConditionalName> must resolve to something defined
in all_defs or else it throws ActionNotDefinedError.
Source§impl ActionEntityUID<InternalName>
impl ActionEntityUID<InternalName>
Sourcepub fn ty(&self) -> &InternalName
pub fn ty(&self) -> &InternalName
Get the action type, as an InternalName.
Trait Implementations§
Source§impl<N: Clone> Clone for ActionEntityUID<N>
impl<N: Clone> Clone for ActionEntityUID<N>
Source§fn clone(&self) -> ActionEntityUID<N>
fn clone(&self) -> ActionEntityUID<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<N: Debug> Debug for ActionEntityUID<N>
impl<N: Debug> Debug for ActionEntityUID<N>
Source§impl<'de, N> Deserialize<'de> for ActionEntityUID<N>
impl<'de, N> Deserialize<'de> for ActionEntityUID<N>
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>,
Source§impl<N: Display> Display for ActionEntityUID<N>
impl<N: Display> Display for ActionEntityUID<N>
Source§impl From<ActionEntityUID<Name>> for EntityUID
impl From<ActionEntityUID<Name>> for EntityUID
Source§fn from(aeuid: ActionEntityUID<Name>) -> Self
fn from(aeuid: ActionEntityUID<Name>) -> Self
Source§impl<N> Hash for ActionEntityUID<N>
impl<N> Hash for ActionEntityUID<N>
Source§impl<N> PartialEq for ActionEntityUID<N>
impl<N> PartialEq for ActionEntityUID<N>
Source§impl<N> Serialize for ActionEntityUID<N>where
N: Serialize,
impl<N> Serialize for ActionEntityUID<N>where
N: Serialize,
Source§impl TryFrom<ActionEntityUID<InternalName>> for EntityUID
impl TryFrom<ActionEntityUID<InternalName>> for EntityUID
Source§type Error = <InternalName as TryInto<Name>>::Error
type Error = <InternalName as TryInto<Name>>::Error
Source§fn try_from(
aeuid: ActionEntityUID<InternalName>,
) -> Result<Self, <InternalName as TryInto<Name>>::Error>
fn try_from( aeuid: ActionEntityUID<InternalName>, ) -> Result<Self, <InternalName as TryInto<Name>>::Error>
impl<N> Eq for ActionEntityUID<N>
Auto Trait Implementations§
impl<N> Freeze for ActionEntityUID<N>where
N: Freeze,
impl<N> RefUnwindSafe for ActionEntityUID<N>where
N: RefUnwindSafe,
impl<N> Send for ActionEntityUID<N>where
N: Send,
impl<N> Sync for ActionEntityUID<N>where
N: Sync,
impl<N> Unpin for ActionEntityUID<N>where
N: Unpin,
impl<N> UnwindSafe for ActionEntityUID<N>where
N: UnwindSafe,
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
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
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>
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>
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