Skip to main content

OptionalValueObject

Trait OptionalValueObject 

Source
pub trait OptionalValueObject<T: ValueObject> {
    // Required method
    fn validate_if_present(&self) -> Result<(), T::Error>;
}
Expand description

Extension trait for optional value objects.

Required Methods§

Source

fn validate_if_present(&self) -> Result<(), T::Error>

Validate the inner value if present.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: ValueObject> OptionalValueObject<T> for Option<T>

Implementors§