Struct abbau_types::Attribute

source ·
pub struct Attribute {
    pub id: Option<String>,
    pub doc: Option<String>,
    pub doc_ref: Option<StringOrArray>,
    pub ty: Option<TypeRef>,
    pub size: Option<String>,
    pub if_expr: Option<String>,
    pub repeat: Option<Repeat>,
    pub repeat_expr: Option<String>,
    pub repeat_until: Option<String>,
    pub contents: Option<Contents>,
    pub encoding: Option<String>,
    pub enum: Option<String>,
}
Expand description

An attribute in a type schema

Fields§

§id: Option<String>

Unique Identifier within this struct

Attributes with the same name are merged

§doc: Option<String>

Used to give a more detailed description of a user-defined type.

§doc_ref: Option<StringOrArray>

Reference to external documentation

§ty: Option<TypeRef>

The type of this attribute

§size: Option<String>

The size of this attribute (if present, creates a substream)

§if_expr: Option<String>

The size of this attribute (if present, creates a substream)

§repeat: Option<Repeat>

Whether this attribute is repeated

§repeat_expr: Option<String>

If Repeat::Expr, the expression to repeat

§repeat_until: Option<String>

If Repeat::Expr, the expression to check for repetition end

§contents: Option<Contents>

Fixed expected contents

§encoding: Option<String>

String encoding

§enum: Option<String>

Name of an enumeration

Trait Implementations§

source§

impl Debug for Attribute

source§

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

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

impl<'de> Deserialize<'de> for Attribute

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: for<'de> Deserialize<'de>,