pub struct Context<'a> {
pub default_dict: Arc<dyn Dict + 'a>,
/* private fields */
}Expand description
Fields§
§default_dict: Arc<dyn Dict + 'a>Implementations§
Source§impl<'a> Context<'a>
impl<'a> Context<'a>
pub fn new( generator: impl IntoIterator<Item = Arc<dyn GeneratorFunc>>, dict: impl IntoIterator<Item = Arc<dyn Dict + 'a>>, default_dict: Arc<dyn Dict + 'a>, ) -> Self
Sourcepub fn with_default_dict(&mut self, default_dict: Arc<dyn Dict + 'a>) -> Self
pub fn with_default_dict(&mut self, default_dict: Arc<dyn Dict + 'a>) -> Self
Returns a context with the specified default Dict.
The dict is added to the lookup table for the returned context. It may or may not be added
to the table for the original context, depending whether there are other clones of the
context or not (see Arc::make_mut.)
pub fn dict_hash(args: &[&str]) -> Option<[u8; 32]>
pub fn get_generator( &self, name: &str, ) -> Result<Arc<dyn GeneratorFunc>, NotFound>
pub fn get_dict( &self, hash: &Option<[u8; 32]>, ) -> Result<Arc<dyn Dict + 'a>, NotFound>
Trait Implementations§
Source§impl<'a> Extend<Arc<dyn Dict + 'a>> for Context<'a>
impl<'a> Extend<Arc<dyn Dict + 'a>> for Context<'a>
Source§fn extend<T: IntoIterator<Item = Arc<dyn Dict + 'a>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Arc<dyn Dict + 'a>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more