pub enum EntityAttributes<N> {
RecordAttributes(RecordOrContextAttributes<N>),
EntityAttributes(EntityAttributesInternal<N>),
}
Expand description
Declaration of entity attributes
The parameter N
is the type of entity type names and common type names in
this EntityAttributes
, including recursively.
See notes on Fragment
.
Variants§
RecordAttributes(RecordOrContextAttributes<N>)
Anything valid as record attributes is valid as entity attributes. Notably, this includes the possibility that we have a single common-type reference, and not actually a record declaration.
EntityAttributes(EntityAttributesInternal<N>)
EntityAttributesInternal
is an analogue of
RecordOrContextAttributes
that covers the JSON forms accepted for
entity attributes but not record attributes
Implementations§
source§impl<N> EntityAttributes<N>
impl<N> EntityAttributes<N>
sourcepub fn is_empty_record(&self) -> bool
pub fn is_empty_record(&self) -> bool
Is this EntityAttributes
an empty record?
source§impl EntityAttributes<RawName>
impl EntityAttributes<RawName>
sourcepub fn conditionally_qualify_type_references(
self,
ns: Option<&InternalName>,
) -> EntityAttributes<ConditionalName>
pub fn conditionally_qualify_type_references( self, ns: Option<&InternalName>, ) -> EntityAttributes<ConditionalName>
(Conditionally) prefix unqualified entity and common type references with the namespace they are in
source§impl EntityAttributes<ConditionalName>
impl EntityAttributes<ConditionalName>
sourcepub fn fully_qualify_type_references(
self,
all_defs: &AllDefs,
) -> Result<EntityAttributes<InternalName>, TypeNotDefinedError>
pub fn fully_qualify_type_references( self, all_defs: &AllDefs, ) -> Result<EntityAttributes<InternalName>, TypeNotDefinedError>
Convert this EntityAttributes<ConditionalName>
into a
EntityAttributes<InternalName>
by fully-qualifying all typenames
that appear anywhere in any definitions.
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).
Trait Implementations§
source§impl<N: Clone> Clone for EntityAttributes<N>
impl<N: Clone> Clone for EntityAttributes<N>
source§fn clone(&self) -> EntityAttributes<N>
fn clone(&self) -> EntityAttributes<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 EntityAttributes<N>
impl<N: Debug> Debug for EntityAttributes<N>
source§impl<N> Default for EntityAttributes<N>
impl<N> Default for EntityAttributes<N>
source§impl<'de, N: Deserialize<'de> + From<RawName>> Deserialize<'de> for EntityAttributes<N>
impl<'de, N: Deserialize<'de> + From<RawName>> Deserialize<'de> for EntityAttributes<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 EntityAttributes<N>
impl<N: Display> Display for EntityAttributes<N>
source§impl<N> From<RecordType<EntityAttributeType<N>>> for EntityAttributes<N>
impl<N> From<RecordType<EntityAttributeType<N>>> for EntityAttributes<N>
source§fn from(rty: RecordType<EntityAttributeType<N>>) -> EntityAttributes<N>
fn from(rty: RecordType<EntityAttributeType<N>>) -> EntityAttributes<N>
source§impl<N> From<RecordType<RecordAttributeType<N>>> for EntityAttributes<N>
impl<N> From<RecordType<RecordAttributeType<N>>> for EntityAttributes<N>
source§fn from(rty: RecordType<RecordAttributeType<N>>) -> EntityAttributes<N>
fn from(rty: RecordType<RecordAttributeType<N>>) -> EntityAttributes<N>
source§impl<N: PartialEq> PartialEq for EntityAttributes<N>
impl<N: PartialEq> PartialEq for EntityAttributes<N>
source§impl<N> Serialize for EntityAttributes<N>where
N: Serialize,
impl<N> Serialize for EntityAttributes<N>where
N: Serialize,
impl<N> StructuralPartialEq for EntityAttributes<N>
Auto Trait Implementations§
impl<N> Freeze for EntityAttributes<N>where
N: Freeze,
impl<N> RefUnwindSafe for EntityAttributes<N>where
N: RefUnwindSafe,
impl<N> Send for EntityAttributes<N>where
N: Send,
impl<N> Sync for EntityAttributes<N>where
N: Sync,
impl<N> Unpin for EntityAttributes<N>where
N: Unpin,
impl<N> UnwindSafe for EntityAttributes<N>where
N: UnwindSafe + RefUnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
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