pub struct TreeAssertion<K = String> { /* private fields */ }
Expand description
Struct for matching against a Data tree (DiagnosticsHierarchy).
Implementations§
Source§impl<K> TreeAssertion<K>
impl<K> TreeAssertion<K>
Sourcepub fn new(name: &str, exact_match: bool) -> Self
pub fn new(name: &str, exact_match: bool) -> Self
Create a new TreeAssertion
. The |name| argument is the expected name of the tree to be
compared against. Set |exact_match| to true to specify that all properties and children of
the tree should be checked. To perform partial matching of the tree, set it to false.
Sourcepub fn add_property_assertion(
&mut self,
key: &str,
assertion: Box<dyn PropertyAssertion<K>>,
)
pub fn add_property_assertion( &mut self, key: &str, assertion: Box<dyn PropertyAssertion<K>>, )
Adds a property assertion to this tree assertion.
Sourcepub fn add_child_assertion(&mut self, assertion: TreeAssertion<K>)
pub fn add_child_assertion(&mut self, assertion: TreeAssertion<K>)
Adds a tree assertion as a child of this tree assertion.
Auto Trait Implementations§
impl<K> Freeze for TreeAssertion<K>
impl<K = String> !RefUnwindSafe for TreeAssertion<K>
impl<K = String> !Send for TreeAssertion<K>
impl<K = String> !Sync for TreeAssertion<K>
impl<K> Unpin for TreeAssertion<K>
impl<K = String> !UnwindSafe for TreeAssertion<K>
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