binaryninja::types

Struct QualifiedName

source
pub struct QualifiedName {
    pub separator: String,
    pub items: Vec<String>,
}

Fields§

§separator: String§items: Vec<String>

Implementations§

source§

impl QualifiedName

source

pub fn into_raw(value: Self) -> BNQualifiedName

source

pub fn new(items: Vec<String>) -> Self

source

pub fn new_with_separator(items: Vec<String>, separator: String) -> Self

source

pub fn with_item(&self, item: impl Into<String>) -> Self

source

pub fn push(&mut self, item: String)

source

pub fn pop(&mut self) -> Option<String>

source

pub fn insert(&mut self, index: usize, item: String)

source

pub fn split_last(&self) -> Option<(String, QualifiedName)>

source

pub fn replace(&self, from: &str, to: &str) -> Self

Replaces all occurrences of a substring with another string in all items of the QualifiedName and returns an owned version of the modified QualifiedName.

§Example
use binaryninja::types::QualifiedName;

let qualified_name =
    QualifiedName::new(vec!["my::namespace".to_string(), "mytype".to_string()]);
let replaced = qualified_name.replace("my", "your");
assert_eq!(
    replaced.items,
    vec!["your::namespace".to_string(), "yourtype".to_string()]
);
source

pub fn last(&self) -> Option<&String>

Returns the last item, or None if it is empty.

source

pub fn last_mut(&mut self) -> Option<&mut String>

Returns a mutable reference to the last item, or None if it is empty.

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

A QualifiedName is empty if it has no items.

If you want to know if the unqualified name is empty (i.e. no characters) you must first convert the qualified name to unqualified via the to_string method.

Trait Implementations§

source§

impl BnStrCompatible for &QualifiedName

source§

impl Clone for QualifiedName

source§

fn clone(&self) -> QualifiedName

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CoreArrayProvider for QualifiedName

source§

impl Debug for QualifiedName

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for QualifiedName

source§

fn default() -> QualifiedName

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

impl Display for QualifiedName

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&String> for QualifiedName

source§

fn from(value: &String) -> Self

Converts to this type from the input type.
source§

impl From<&str> for QualifiedName

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl From<Cow<'_, str>> for QualifiedName

source§

fn from(value: Cow<'_, str>) -> Self

Converts to this type from the input type.
source§

impl From<QualifiedName> for String

source§

fn from(value: QualifiedName) -> Self

Converts to this type from the input type.
source§

impl From<String> for QualifiedName

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl From<Vec<&str>> for QualifiedName

source§

fn from(value: Vec<&str>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<String>> for QualifiedName

source§

fn from(value: Vec<String>) -> Self

Converts to this type from the input type.
source§

impl Hash for QualifiedName

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Index<usize> for QualifiedName

source§

type Output = String

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<usize> for QualifiedName

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl Ord for QualifiedName

source§

fn cmp(&self, other: &QualifiedName) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for QualifiedName

source§

fn eq(&self, other: &QualifiedName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for QualifiedName

source§

fn partial_cmp(&self, other: &QualifiedName) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for QualifiedName

source§

impl StructuralPartialEq for QualifiedName

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.