Struct texlang_testing::TestingComponent
source · pub struct TestingComponent { /* private fields */ }
Expand description
Texlang component that every unit testing state needs to have.
Implementations§
source§impl TestingComponent
impl TestingComponent
sourcepub fn recoverable_error_hook<S: HasComponent<Self>>(
vm: &VM<S>,
recoverable_error: Box<Error>
) -> Result<(), Box<Error>>
pub fn recoverable_error_hook<S: HasComponent<Self>>( vm: &VM<S>, recoverable_error: Box<Error> ) -> Result<(), Box<Error>>
Recoverable error hook for the testing component.
States used in unit testing must be configured to use this hook.
sourcepub fn get_integer<S: HasComponent<TestingComponent>>() -> BuiltIn<S>
pub fn get_integer<S: HasComponent<TestingComponent>>() -> BuiltIn<S>
Returns an integer variable command that references an integer stored in the testing component.
If you’re writing a unit test that needs an integer variable it’s easiest to use this rather than building your own variable.
Trait Implementations§
source§impl Default for TestingComponent
impl Default for TestingComponent
source§fn default() -> TestingComponent
fn default() -> TestingComponent
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TestingComponent
impl<'de> Deserialize<'de> for TestingComponent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl HasComponent<TestingComponent> for State
impl HasComponent<TestingComponent> for State
source§fn component(&self) -> &TestingComponent
fn component(&self) -> &TestingComponent
Return a immutable reference to the component.
source§fn component_mut(&mut self) -> &mut TestingComponent
fn component_mut(&mut self) -> &mut TestingComponent
Return a mutable reference to the component.
Auto Trait Implementations§
impl !RefUnwindSafe for TestingComponent
impl Send for TestingComponent
impl !Sync for TestingComponent
impl Unpin for TestingComponent
impl UnwindSafe for TestingComponent
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