Struct CilType
pub struct CilType {Show 20 fields
pub token: Token,
pub namespace: String,
pub name: String,
pub external: Option<CilTypeReference>,
pub flags: u32,
pub fields: FieldList,
pub methods: MethodRefList,
pub properties: PropertyList,
pub events: EventList,
pub interfaces: CilTypeRefList,
pub overwrites: Arc<Vec<CilTypeReference>>,
pub nested_types: CilTypeRefList,
pub generic_params: GenericParamList,
pub generic_args: MethodSpecList,
pub custom_attributes: CustomAttributeValueList,
pub packing_size: OnceLock<u16>,
pub class_size: OnceLock<u32>,
pub spec: OnceLock<CilFlavor>,
pub modifiers: Arc<Vec<CilModifier>>,
pub security: OnceLock<Security>,
/* private fields */
}Expand description
Represents a ‘Type’, close to TypeDef and TypeRef but as a combined item, containing
more information. The Token will match either the TypeDef or TypeRef or TypeSpec or
TypeBase (artificial, for mapping to specific primitive types supported in the runtime).
Fields§
§token: TokenToken
namespace: StringTypeNamespace (can be empty, e.g. for artificial <module> (globals) )
name: StringTypeName
external: Option<CilTypeReference>Type is imported (e.g. AssemblyRef, File, ModuleRef, …)
flags: u32Flags (a 4-byte bitmask of type TypeAttributes, §II.23.1.15)
fields: FieldListAll fields this type has
methods: MethodRefListAll methods this type has
properties: PropertyListAll properties this type has
events: EventListAll events this type has
interfaces: CilTypeRefListAll interfaces this class implements
overwrites: Arc<Vec<CilTypeReference>>All method overwrites this type implements (e.g. Interfaces)
nested_types: CilTypeRefListAll types that are ‘contained’ in this type
generic_params: GenericParamListAll generic parameters this type has (type information, not the instantiated version)
generic_args: MethodSpecListAll generic arguments this type has (instantiated version)
custom_attributes: CustomAttributeValueListAll custom attributes this type has
packing_size: OnceLock<u16>a 2-byte value, specifying the alignment of fields
class_size: OnceLock<u32>a 4-byte value, specifying the size of the class
spec: OnceLock<CilFlavor>TypeSpec specifiers for the type
modifiers: Arc<Vec<CilModifier>>Type modifiers from TypeSpec for this type
security: OnceLock<Security>The .NET CIL Security Information (if present)
Implementations§
§impl CilType
impl CilType
pub fn new(
token: Token,
namespace: String,
name: String,
external: Option<CilTypeReference>,
base: Option<CilTypeRef>,
flags: u32,
fields: FieldList,
methods: MethodRefList,
flavor: Option<CilFlavor>,
) -> Self
pub fn new( token: Token, namespace: String, name: String, external: Option<CilTypeReference>, base: Option<CilTypeRef>, flags: u32, fields: FieldList, methods: MethodRefList, flavor: Option<CilFlavor>, ) -> Self
Create a new instance of a CilType
§Arguments
token- The token for this typenamespace- The namespace of the typename- The name of the typeexternal- External type reference if this is an imported typebase- Base type reference if this type inherits from anotherflags- Type attributes flagsfields- Fields belonging to this typemethods- Methods belonging to this typeflavor- Optional explicit flavor. If None, flavor will be computed lazily
pub fn set_base(&self, base_type: CilTypeRef) -> Result<(), CilTypeRef>
pub fn set_base(&self, base_type: CilTypeRef) -> Result<(), CilTypeRef>
Auto Trait Implementations§
impl !Freeze for CilType
impl RefUnwindSafe for CilType
impl Send for CilType
impl Sync for CilType
impl Unpin for CilType
impl UnwindSafe for CilType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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