Trait moniker::MonikerBase

source ·
pub trait MonikerBase: Default + Eq + PartialEq + Debug + Clone + Hash + Display {
    type Part: ChildNameBase;

Show 15 methods // Required methods fn new(path: Vec<Self::Part>) -> Self; fn path(&self) -> &Vec<Self::Part>; fn path_mut(&mut self) -> &mut Vec<Self::Part>; // Provided methods fn parse<T: AsRef<str>>(path: &[T]) -> Result<Self, MonikerError> { ... } fn parse_str(input: &str) -> Result<Self, MonikerError> { ... } fn concat<T: MonikerBase<Part = Self::Part>>(&self, other: &T) -> Self { ... } fn has_prefix<S: MonikerBase<Part = Self::Part>>(&self, prefix: &S) -> bool { ... } fn root() -> Self { ... } fn leaf(&self) -> Option<&Self::Part> { ... } fn is_root(&self) -> bool { ... } fn parent(&self) -> Option<Self> { ... } fn child(&self, child: Self::Part) -> Self { ... } fn strip_prefix<T: MonikerBase<Part = Self::Part>>( &self, prefix: &T ) -> Result<Self, MonikerError> { ... } fn compare(&self, other: &Self) -> Ordering { ... } fn format(&self, f: &mut Formatter<'_>) -> Result { ... }
}
Expand description

MonikerBase is the common trait for both InstancedMoniker and Moniker concrete types.

MonikerBase describes the identity of a component instance in terms of its path relative to the root of the component instance tree.

Required Associated Types§

Required Methods§

source

fn new(path: Vec<Self::Part>) -> Self

source

fn path(&self) -> &Vec<Self::Part>

source

fn path_mut(&mut self) -> &mut Vec<Self::Part>

Provided Methods§

source

fn parse<T: AsRef<str>>(path: &[T]) -> Result<Self, MonikerError>

source

fn parse_str(input: &str) -> Result<Self, MonikerError>

source

fn concat<T: MonikerBase<Part = Self::Part>>(&self, other: &T) -> Self

Concatenates other onto the end of this moniker.

source

fn has_prefix<S: MonikerBase<Part = Self::Part>>(&self, prefix: &S) -> bool

Indicates whether this moniker is prefixed by prefix.

source

fn root() -> Self

source

fn leaf(&self) -> Option<&Self::Part>

source

fn is_root(&self) -> bool

source

fn parent(&self) -> Option<Self>

source

fn child(&self, child: Self::Part) -> Self

source

fn strip_prefix<T: MonikerBase<Part = Self::Part>>( &self, prefix: &T ) -> Result<Self, MonikerError>

Strips the moniker parts in prefix from the beginning of this moniker.

source

fn compare(&self, other: &Self) -> Ordering

source

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

Object Safety§

This trait is not object safe.

Implementors§