Field

Struct Field 

Source
pub struct Field {
Show 17 fields pub name: Option<Identifier>, pub notation: Option<Notation>, pub basetype: Identifier, pub is_const: bool, pub is_struct: bool, pub reference: Option<ReferenceType>, pub optional: Option<CommaSeparatedBooleans>, pub auto_validity: bool, pub sync: Option<String>, pub type_enums: Option<CommaSeparatedIdentifiers>, pub array: Option<ArrayType>, pub size: Option<ArraySize>, pub size_enumref: Option<Identifier>, pub c_size: Option<CExpression>, pub null_terminate: bool, pub successcodes: Option<CommaSeparatedIdentifiers>, pub errorcodes: Option<CommaSeparatedIdentifiers>,
}
Expand description

A typed field used in many different contexts.

Field can be used in the following ways:

  • Struct member
  • Union member
  • Function parameter
  • Function return type

Fields§

§name: Option<Identifier>

name will always be present when used as a struct or union member.

name will most likely be present when used as a function parameter.

name will never be present when used as a function return type.

§notation: Option<Notation>§basetype: Identifier

The type of the field.

§is_const: bool

If true, then the variable’s base type is constant. If the type is a pointer or array, the const refers to the base type. So const T * rather than T *const.

§is_struct: bool

If true, then the basetype name needs to be preceeded by the C keyword struct when interfacing with C.

§reference: Option<ReferenceType>

If present, then the variable is a pointer of some sort. This does not guarantee that variable is an array.

§optional: Option<CommaSeparatedBooleans>

Each boolean value represents a particular indirection, starting from the outermost pointer. The true/false represents whether that indirection is optional. For example, if an integer pointer type has optional set to false,true, this means that the pointer is required, but the integer value may be zero.

§auto_validity: bool

If set to false, then auto-validation for the variable should not be generated.

§sync: Option<String>

If present, will be either true or an expression that more explicitly describes how it must externally sync. If absent, then external synchronization is not necessary.

§type_enums: Option<CommaSeparatedIdentifiers>

Comma-separated list of enumerators that this member can be given.

§array: Option<ArrayType>§size: Option<ArraySize>§size_enumref: Option<Identifier>

The length of a static array variable, specified as an enumerator reference.

§c_size: Option<CExpression>

A C expression that specifies the number of elements in a static or dynamic array.

§null_terminate: bool

If true, then a string variable (some form of pointer with the type char) is null-terminated. If the type is a pointer-pointer or a pointer-const-pointer, then the null-terminator refers only to the innermost string pointers.

§successcodes: Option<CommaSeparatedIdentifiers>

successcodes may contain a value only if Field is used as a function return type.

Specifies the return codes that represent successful function execution. When not specified, then the command doesn’t return VkResult

§errorcodes: Option<CommaSeparatedIdentifiers>

errorcodes may contain a value only if Field is used as a function return type.

Specifies the return codes that represent error conditions. When not specified, either the command doesn’t return VkResult or it cannot “fail”.

Trait Implementations§

Source§

impl Debug for Field

Source§

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

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

impl<'de> Deserialize<'de> for Field

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 Serialize for Field

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

Auto Trait Implementations§

§

impl Freeze for Field

§

impl RefUnwindSafe for Field

§

impl Send for Field

§

impl Sync for Field

§

impl Unpin for Field

§

impl UnwindSafe for Field

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