View

Trait View 

Source
pub trait View {
    type ViewType: Default;

    // Required methods
    fn to_view(&self) -> Self::ViewType;
    fn from_view(view: Self::ViewType) -> Self;
}
Expand description

View Recursive for all field/value nodes

Required Associated Types§

Required Methods§

Source

fn to_view(&self) -> Self::ViewType

Source

fn from_view(view: Self::ViewType) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl View for bool

Source§

type ViewType = bool

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for f32

Source§

type ViewType = f32

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for f64

Source§

type ViewType = f64

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for i8

Source§

type ViewType = i8

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for i16

Source§

type ViewType = i16

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for i32

Source§

type ViewType = i32

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for i64

Source§

type ViewType = i64

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for u8

Source§

type ViewType = u8

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for u16

Source§

type ViewType = u16

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for u32

Source§

type ViewType = u32

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for u64

Source§

type ViewType = u64

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl View for String

Source§

type ViewType = String

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl<K, V, S> View for HashMap<K, V, S>
where K: View + Eq + Hash + Clone, V: View, S: BuildHasher + Default,

Source§

type ViewType = Vec<(<K as View>::ViewType, <V as View>::ViewType)>

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl<T, S> View for HashSet<T, S>
where T: View + Eq + Hash + Clone, S: BuildHasher + Default,

Source§

type ViewType = Vec<<T as View>::ViewType>

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl<T: View> View for Option<T>

Source§

type ViewType = Option<<T as View>::ViewType>

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl<T: View> View for Box<T>

Source§

type ViewType = <T as View>::ViewType

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Source§

impl<T: View> View for Vec<T>

Source§

type ViewType = Vec<<T as View>::ViewType>

Source§

fn to_view(&self) -> Self::ViewType

Source§

fn from_view(view: Self::ViewType) -> Self

Implementors§