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>

source

pub fn is_empty_record(&self) -> bool

Is this EntityAttributes an empty record?

source§

impl EntityAttributes<RawName>

source

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>

source

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>

source§

fn clone(&self) -> EntityAttributes<N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N: Debug> Debug for EntityAttributes<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N> Default for EntityAttributes<N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<N: Display> Display for EntityAttributes<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N> From<RecordType<EntityAttributeType<N>>> for EntityAttributes<N>

source§

fn from(rty: RecordType<EntityAttributeType<N>>) -> EntityAttributes<N>

Converts to this type from the input type.
source§

impl<N> From<RecordType<RecordAttributeType<N>>> for EntityAttributes<N>

source§

fn from(rty: RecordType<RecordAttributeType<N>>) -> EntityAttributes<N>

Converts to this type from the input type.
source§

impl<N: PartialEq> PartialEq for EntityAttributes<N>

source§

fn eq(&self, other: &EntityAttributes<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<N> Serialize for EntityAttributes<N>
where N: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

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>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,