File

Struct File 

Source
pub struct File { /* private fields */ }
Expand description

Represents an ECMA-335 file in memory so that it can be built incrementally.

Implementations§

Source§

impl File

Source

pub fn into_stream(self) -> Vec<u8>

Source§

impl File

Source

pub fn new(name: &str) -> Self

Creates a minimal ECMA-335 file representation.

Source

pub fn ImplMap( &mut self, method: MethodDef, flags: PInvokeAttributes, import_name: &str, import_scope: &str, )

Source

pub fn TypeDef( &mut self, namespace: &str, name: &str, extends: TypeDefOrRef, flags: TypeAttributes, ) -> TypeDef

Adds a TypeDef row to the file, returning the row offset.

Source

pub fn TypeRef(&mut self, namespace: &str, name: &str) -> TypeRef

Adds a TypeRef row to the file, returning the row offset.

Source

pub fn TypeSpec( &mut self, namespace: &str, name: &str, generics: &[Type], ) -> TypeSpec

Source

pub fn Field(&mut self, name: &str, ty: &Type, flags: FieldAttributes) -> Field

Adds a Field row to the file, returning the row offset.

Source

pub fn MethodDef( &mut self, name: &str, signature: &Signature, flags: MethodAttributes, impl_flags: MethodImplAttributes, ) -> MethodDef

Adds a MethodDef row to the file, returning the row offset.

Source

pub fn MemberRef( &mut self, name: &str, signature: &Signature, parent: MemberRefParent, ) -> MemberRef

Source

pub fn Param( &mut self, name: &str, sequence: u16, flags: ParamAttributes, ) -> Param

Adds a Param row to the file, returning the row offset.

Source

pub fn Attribute( &mut self, parent: HasAttribute, ty: AttributeType, value: &[(String, Value)], )

Adds an Attribute row to the file. This is a sorted table so the row offset is not yet available.

Source

pub fn Constant(&mut self, parent: HasConstant, value: &Value)

Source

pub fn GenericParam( &mut self, name: &str, owner: TypeOrMethodDef, number: u16, flags: GenericParamAttributes, )

Source

pub fn ClassLayout( &mut self, parent: TypeDef, packing_size: u16, class_size: u32, )

Source

pub fn NestedClass(&mut self, inner: TypeDef, outer: TypeDef)

Source

pub fn InterfaceImpl( &mut self, class: TypeDef, interface: &Type, ) -> InterfaceImpl

Trait Implementations§

Source§

impl Default for File

Source§

fn default() -> File

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

Auto Trait Implementations§

§

impl Freeze for File

§

impl RefUnwindSafe for File

§

impl Send for File

§

impl Sync for File

§

impl Unpin for File

§

impl UnwindSafe for File

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.