Skip to main content

MsgTree

Struct MsgTree 

Source
pub struct MsgTree<K> { /* private fields */ }
Expand description

Aggregates output lines into a tree structure for deduplication.

Implementations§

Source§

impl<K: Eq + Hash + Clone> MsgTree<K>

Source

pub fn new(mode: MsgTreeMode) -> Self

Create a new MsgTree with the given mode.

Source

pub fn add(&mut self, key: K, msgline: Vec<u8>)

Add a message line for the given key.

Source

pub fn len(&self) -> usize

Return the number of keys contained in the MsgTree.

Source

pub fn is_empty(&self) -> bool

Returns true if the MsgTree contains no keys.

Source

pub fn clear(&mut self)

Remove all items from the MsgTree.

Source

pub fn get(&self, key: &K) -> Option<MsgTreeElem<'_, K>>

Return the message for key if key is in the MsgTree.

Source

pub fn keys(&self) -> impl Iterator<Item = &K>

Return an iterator over MsgTree’s keys.

Source

pub fn walk<'a>( &'a mut self, match_filter: Option<&'a dyn Fn(&K) -> bool>, ) -> WalkIter<'a, K> ⓘ

Walk the tree and return an iterator over (message, keys) tuples.

Source

pub fn walk_trace<'a>( &'a mut self, match_filter: Option<&'a dyn Fn(&K) -> bool>, ) -> WalkTraceIter<'a, K> ⓘ

Walk the tree in trace mode. Only valid in Trace mode.

Source

pub fn remove(&mut self, match_filter: &dyn Fn(&K) -> bool)

Remove keys matching the filter

Trait Implementations§

Source§

impl<K: Debug> Debug for MsgTree<K>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<K> Freeze for MsgTree<K>
where SlotMap<DefaultKey, MsgTreeNode<K>>: Freeze, HashMap<K, DefaultKey>: Freeze,

§

impl<K> RefUnwindSafe for MsgTree<K>

§

impl<K> Send for MsgTree<K>
where SlotMap<DefaultKey, MsgTreeNode<K>>: Send, HashMap<K, DefaultKey>: Send,

§

impl<K> Sync for MsgTree<K>
where SlotMap<DefaultKey, MsgTreeNode<K>>: Sync, HashMap<K, DefaultKey>: Sync,

§

impl<K> Unpin for MsgTree<K>
where SlotMap<DefaultKey, MsgTreeNode<K>>: Unpin, HashMap<K, DefaultKey>: Unpin,

§

impl<K> UnsafeUnpin for MsgTree<K>

§

impl<K> UnwindSafe for MsgTree<K>
where SlotMap<DefaultKey, MsgTreeNode<K>>: UnwindSafe, HashMap<K, DefaultKey>: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.