Skip to main content

Wrapped

Trait Wrapped 

Source
pub trait Wrapped:
    ValueObject
    + WrappedInner
    + TryFrom<Self::Inner>
where Self::Error: Error + Send + Sync + 'static,
{ // Required methods fn as_inner(&self) -> &Self::Inner; fn into_inner(self) -> Self::Inner; }
Expand description

A ValueObject newtype around a single WrappedInner::Inner value, only constructible through validation (TryFrom<Self::Inner>).

Note this invariant only holds if the wrapped field is private - see #[derive(ValueObject)] in ddd-toolkit-macro, which enforces that at derive time.

Required Methods§

Source

fn as_inner(&self) -> &Self::Inner

Borrows the wrapped value.

Source

fn into_inner(self) -> Self::Inner

Consumes self, returning the wrapped value.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§