Skip to main content

Metadata

Struct Metadata 

Source
pub struct Metadata {
Show 15 fields pub version: u32, pub images: Vec<ImageDefinition>, pub assemblies: Vec<AssemblyDefinition>, pub type_definitions: Vec<TypeDefinition>, pub methods: Vec<MethodDefinition>, pub fields: Vec<FieldDefinition>, pub parameters: Vec<ParameterDefinition>, pub properties: Vec<PropertyDefinition>, pub events: Vec<EventDefinition>, pub generic_containers: Vec<GenericContainer>, pub generic_parameters: Vec<GenericParameter>, pub nested_types: Vec<TypeDefinitionIndex>, pub interfaces: Vec<TypeIndex>, pub generic_parameter_constraints: Vec<TypeIndex>, pub field_default_values: Vec<FieldDefaultValue>, /* private fields */
}

Fields§

§version: u32§images: Vec<ImageDefinition>§assemblies: Vec<AssemblyDefinition>§type_definitions: Vec<TypeDefinition>§methods: Vec<MethodDefinition>§fields: Vec<FieldDefinition>§parameters: Vec<ParameterDefinition>§properties: Vec<PropertyDefinition>§events: Vec<EventDefinition>§generic_containers: Vec<GenericContainer>§generic_parameters: Vec<GenericParameter>§nested_types: Vec<TypeDefinitionIndex>§interfaces: Vec<TypeIndex>§generic_parameter_constraints: Vec<TypeIndex>§field_default_values: Vec<FieldDefaultValue>

Implementations§

Source§

impl Metadata

Source

pub fn from_path(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn parse(data: Vec<u8>) -> Result<Self>

Source

pub fn string(&self, index: u32) -> &str

A string from the #Strings-like string section.

Source

pub fn type_name(&self, index: TypeDefinitionIndex) -> &str

Source

pub fn type_full_name(&self, index: TypeDefinitionIndex) -> String

Namespace.Name, with / separating nested types.

Source

pub fn declaring_type_definition( &self, index: TypeDefinitionIndex, ) -> Option<TypeDefinitionIndex>

The enclosing type definition, found through the nested type lists.

Source

pub fn image_name(&self, image: &ImageDefinition) -> &str

Source

pub fn image_types(&self, image: &ImageDefinition) -> Range<TypeDefinitionIndex> ⓘ

Type definition indices belonging to image.

Source

pub fn type_methods(&self, t: &TypeDefinition) -> &[MethodDefinition]

Source

pub fn type_fields(&self, t: &TypeDefinition) -> &[FieldDefinition]

Source

pub fn default_value_data(&self, index: i32) -> &[u8] ⓘ

Bytes of the default value data section from index on.

Source

pub fn generic_container_parameters( &self, container: i32, ) -> &[GenericParameter]

Source

pub fn method_parameters(&self, m: &MethodDefinition) -> &[ParameterDefinition]

Trait Implementations§

Source§

impl<'ʄ> Facet<'ʄ> for Metadata

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.