pub struct ReprId { /* private fields */ }Expand description
The identity of a representation rule.
Identity is the rule’s NAME – its Rust type name, which is unique
across the registry. A representation’s short name is not unique: nine representations are
called packed, four components, four occurrence. Wrapping the identity in its own type
keeps a short name from being used as one by accident, which has silently broken rules before.
The short name travels along for display, so rendering a represented name costs no lookup.
Implementations§
Source§impl ReprId
impl ReprId
Sourcepub const fn new(name: &'static str, short_name: &'static str) -> ReprId
pub const fn new(name: &'static str, short_name: &'static str) -> ReprId
Builds an id from a rule’s name and short name.
Prefer ReprRule::id or ReprRuleStored::id
over calling this directly; those cannot disagree with the registry.
Sourcepub fn short_name(self) -> &'static str
pub fn short_name(self) -> &'static str
The Essence-facing name, which several representations may share.
Trait Implementations§
impl Copy for ReprId
Source§impl<'de> Deserialize<'de> for ReprId
impl<'de> Deserialize<'de> for ReprId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ReprId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ReprId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for ReprId
Displays the short name, which is what Essence and represented variable names use.
impl Display for ReprId
Displays the short name, which is what Essence and represented variable names use.
impl Eq for ReprId
Source§impl Ord for ReprId
impl Ord for ReprId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for ReprId
impl PartialOrd for ReprId
Source§impl Quine for ReprId
impl Quine for ReprId
fn ctor_tokens(&self) -> TokenStream
Source§impl Serialize for ReprId
Serialises as the unique name, so stored models survive a short-name change.
impl Serialize for ReprId
Serialises as the unique name, so stored models survive a short-name change.
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for ReprId
impl RefUnwindSafe for ReprId
impl Send for ReprId
impl Sync for ReprId
impl Unpin for ReprId
impl UnsafeUnpin for ReprId
impl UnwindSafe for ReprId
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreimpl<N> NodeTrait for N
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes