pub struct Context<T> { /* private fields */ }Expand description
An evaluation context used to retrieve bindings in test set expressions.
Implementations§
Source§impl<T> Context<T>
impl<T> Context<T>
Sourcepub fn bind<V: Into<Value<T>>>(&mut self, id: Id, value: V) -> Option<Value<T>>
pub fn bind<V: Into<Value<T>>>(&mut self, id: Id, value: V) -> Option<Value<T>>
Inserts a new binding, possibly overriding an old one, returns the old binding if there was one.
Sourcepub fn resolve<I: AsRef<str>>(&self, id: I) -> Result<Value<T>, Error>where
T: Clone,
pub fn resolve<I: AsRef<str>>(&self, id: I) -> Result<Value<T>, Error>where
T: Clone,
Resolves a binding with the given identifier.
Sourcepub fn find_similar(&self, id: &str) -> Vec<Id>
pub fn find_similar(&self, id: &str) -> Vec<Id>
Find similar bindings to the given identifier.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Context<T>
impl<T> !RefUnwindSafe for Context<T>
impl<T> !Send for Context<T>
impl<T> !Sync for Context<T>
impl<T> Unpin for Context<T>
impl<T> !UnwindSafe for Context<T>
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