pub struct ExampleValidator { /* private fields */ }Expand description
Example validator for checking and validating code examples
Implementations§
Source§impl ExampleValidator
impl ExampleValidator
Sourcepub fn new() -> ExampleValidator
pub fn new() -> ExampleValidator
Create a new example validator
Sourcepub fn with_config(
enable_compilation: bool,
enable_execution: bool,
timeout_secs: u64,
) -> ExampleValidator
pub fn with_config( enable_compilation: bool, enable_execution: bool, timeout_secs: u64, ) -> ExampleValidator
Create a new validator with custom configuration
Sourcepub fn validate_examples(
&self,
examples: &[CodeExample],
) -> Result<Vec<CodeExample>, SklearsError>
pub fn validate_examples( &self, examples: &[CodeExample], ) -> Result<Vec<CodeExample>, SklearsError>
Validate a collection of code examples
Sourcepub fn validate_example(
&self,
example: &CodeExample,
) -> Result<CodeExample, SklearsError>
pub fn validate_example( &self, example: &CodeExample, ) -> Result<CodeExample, SklearsError>
Validate a single code example
Sourcepub fn set_validation_rules(&mut self, rules: Vec<ValidationRule>)
pub fn set_validation_rules(&mut self, rules: Vec<ValidationRule>)
Set validation rules
Sourcepub fn set_compilation_enabled(&mut self, enabled: bool)
pub fn set_compilation_enabled(&mut self, enabled: bool)
Enable or disable compilation checking
Sourcepub fn set_execution_enabled(&mut self, enabled: bool)
pub fn set_execution_enabled(&mut self, enabled: bool)
Enable or disable execution checking
Trait Implementations§
Source§impl Clone for ExampleValidator
impl Clone for ExampleValidator
Source§fn clone(&self) -> ExampleValidator
fn clone(&self) -> ExampleValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExampleValidator
impl Debug for ExampleValidator
Source§impl Default for ExampleValidator
impl Default for ExampleValidator
Source§fn default() -> ExampleValidator
fn default() -> ExampleValidator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExampleValidator
impl RefUnwindSafe for ExampleValidator
impl Send for ExampleValidator
impl Sync for ExampleValidator
impl Unpin for ExampleValidator
impl UnwindSafe for ExampleValidator
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