Skip to main content

DefaultValidator

Struct DefaultValidator 

Source
pub struct DefaultValidator {
    pub ops: Box<dyn ValidatorOps>,
}
Expand description

Reference Validator implementation: a generic dispatch shell over any real ValidatorOps implementor.

Doesn’t care what’s boxed inside – the real, filesystem-backed implementor (configbuilder-svc-validator-spi) is constructed by configbuilder-svc-saf and boxed here.

Fields§

§ops: Box<dyn ValidatorOps>

The real ValidatorOps implementor this validator dispatches to.

Implementations§

Source§

impl DefaultValidator

Source

pub fn validate_path(&self, target: &Path) -> Result<(), ConfigError>

Validate a filesystem path using the configured validator, returning configbuilder_pattern_loader::ConfigError directly for callers already working in that error type (e.g. configbuilder-svc-saf’s composition root). External consumers should prefer the Validator trait impl below, which returns ValidatorError.

Trait Implementations§

Source§

impl Validator for DefaultValidator

Source§

fn validate_path(&self, target: &Path) -> Result<(), ValidatorError>

Returns Ok(()) when target is a valid config directory path, Err otherwise. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.