pub struct NamedTypeReference { /* private fields */ }Implementations§
Source§impl NamedTypeReference
impl NamedTypeReference
Sourcepub fn new<T: Into<QualifiedName>>(
type_class: NamedTypeReferenceClass,
name: T,
) -> Ref<Self>
pub fn new<T: Into<QualifiedName>>( type_class: NamedTypeReferenceClass, name: T, ) -> Ref<Self>
Create an NTR to a type that did not come directly from a BinaryView’s types list. That is to say, if you’re referencing a new type you’re GOING to add, use this. You should not assign type ids yourself, that is the responsibility of the BinaryView implementation after your types have been added. Just make sure the names match up and the core will do the id stuff for you.
Sourcepub fn new_with_id<T: Into<QualifiedName>>(
type_class: NamedTypeReferenceClass,
type_id: &str,
name: T,
) -> Ref<Self>
pub fn new_with_id<T: Into<QualifiedName>>( type_class: NamedTypeReferenceClass, type_id: &str, name: T, ) -> Ref<Self>
Create an NTR to a type with an existing type id, which generally means it came directly
from a BinaryView’s types list and its id was looked up using BinaryView::get_type_id.
You should not assign type ids yourself: if you use this to reference a type you are going
to create but have not yet created, you may run into problems when giving your types to
a BinaryView.
pub fn name(&self) -> QualifiedName
pub fn id(&self) -> String
pub fn class(&self) -> NamedTypeReferenceClass
Sourcepub fn target(&self, bv: &BinaryView) -> Option<Ref<Type>>
pub fn target(&self, bv: &BinaryView) -> Option<Ref<Type>>
Type referenced by this NamedTypeReference.
Will return None if the reference is cyclic, or the target type does not exist.
Trait Implementations§
Source§impl Debug for NamedTypeReference
impl Debug for NamedTypeReference
Source§impl Hash for NamedTypeReference
impl Hash for NamedTypeReference
Source§impl PartialEq for NamedTypeReference
impl PartialEq for NamedTypeReference
Source§impl ToOwned for NamedTypeReference
impl ToOwned for NamedTypeReference
Source§type Owned = Ref<NamedTypeReference>
type Owned = Ref<NamedTypeReference>
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
impl Eq for NamedTypeReference
impl StructuralPartialEq for NamedTypeReference
Auto Trait Implementations§
impl Freeze for NamedTypeReference
impl RefUnwindSafe for NamedTypeReference
impl !Send for NamedTypeReference
impl !Sync for NamedTypeReference
impl Unpin for NamedTypeReference
impl UnwindSafe for NamedTypeReference
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