Struct CilTypeRef
pub struct CilTypeRef { /* private fields */ }Expand description
A smart reference to a CilType that automatically handles weak references
to prevent circular reference memory leaks while providing a clean API
Implementations§
§impl CilTypeRef
impl CilTypeRef
pub fn upgrade(&self) -> Option<CilTypeRc>
pub fn upgrade(&self) -> Option<CilTypeRc>
Get a strong reference to the type, returning None if the type has been dropped
pub fn expect(&self, msg: &str) -> CilTypeRc
pub fn expect(&self, msg: &str) -> CilTypeRc
Get a strong reference to the type, panicking if the type has been dropped Use this when you’re certain the type should still exist
§Panics
Panics if the type has been dropped and the weak reference cannot be upgraded.
pub fn nested_types(&self) -> Option<CilTypeRefList>
pub fn nested_types(&self) -> Option<CilTypeRefList>
Get the nested_types collection of the referenced type (if still alive)
pub fn generic_params(&self) -> Option<GenericParamList>
pub fn generic_params(&self) -> Option<GenericParamList>
Get the generic_params collection of the referenced type (if still alive)
pub fn generic_args(&self) -> Option<MethodSpecList>
pub fn generic_args(&self) -> Option<MethodSpecList>
Get the generic_args collection of the referenced type (if still alive)
Trait Implementations§
§impl Clone for CilTypeRef
impl Clone for CilTypeRef
§fn clone(&self) -> CilTypeRef
fn clone(&self) -> CilTypeRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for CilTypeRef
impl Debug for CilTypeRef
Auto Trait Implementations§
impl Freeze for CilTypeRef
impl RefUnwindSafe for CilTypeRef
impl Send for CilTypeRef
impl Sync for CilTypeRef
impl Unpin for CilTypeRef
impl UnwindSafe for CilTypeRef
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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