pub struct ContextBuilder<'a> { /* private fields */ }
Expand description
Used to build a Context.
let context = ContextBuilder::new()
.text("foo = bar")
.build()
.unwrap_or_else(|e| panic!("Failed to build throne context: {}", e));
Implementations§
Source§impl<'a> ContextBuilder<'a>
impl<'a> ContextBuilder<'a>
pub fn new() -> Self
Sourcepub fn text(self, text: &'a str) -> Self
pub fn text(self, text: &'a str) -> Self
Sets the script text used to define the initial state and rules of the Context.
Sourcepub fn string_cache(self, string_cache: StringCache) -> Self
pub fn string_cache(self, string_cache: StringCache) -> Self
Sets the StringCache used for the Context.
Auto Trait Implementations§
impl<'a> Freeze for ContextBuilder<'a>
impl<'a> RefUnwindSafe for ContextBuilder<'a>
impl<'a> Send for ContextBuilder<'a>
impl<'a> Sync for ContextBuilder<'a>
impl<'a> Unpin for ContextBuilder<'a>
impl<'a> !UnwindSafe for ContextBuilder<'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