Struct CustomAttribute
pub struct CustomAttribute {
pub rid: u32,
pub token: Token,
pub offset: usize,
pub parent: CilTypeReference,
pub constructor: CilTypeReference,
pub value: CustomAttributeValue,
}Expand description
The CustomAttribute table associates attributes with elements in various metadata tables. Similar to CustomAttributeRaw but
with resolved indexes and owned data
Fields§
§rid: u32RowID
token: TokenToken
offset: usizeOffset
parent: CilTypeReferenceResolved parent object that has this custom attribute attached
constructor: CilTypeReferenceResolved constructor (MethodDef or MemberRef) for this custom attribute
value: CustomAttributeValueParsed custom attribute value
Implementations§
§impl CustomAttribute
impl CustomAttribute
pub fn apply(&self) -> Result<()>
pub fn apply(&self) -> Result<()>
Apply a CustomAttribute to attach it to its parent metadata element
This method attaches the custom attribute value to its resolved parent object by adding it
to the parent’s custom attribute collection. The custom attribute value is stored as an
Arc<CustomAttributeValue> for efficient memory usage and sharing.
§Errors
Returns an error if the parent type is not supported for custom attributes or if custom attribute storage is not implemented for the parent type.
Auto Trait Implementations§
impl Freeze for CustomAttribute
impl RefUnwindSafe for CustomAttribute
impl Send for CustomAttribute
impl Sync for CustomAttribute
impl Unpin for CustomAttribute
impl UnwindSafe for CustomAttribute
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