Skip to main content

View

Trait View 

Source
pub trait View<'a>: Sized {
    type View;
    type ListView;

    // Required methods
    fn unpack_view(u: &mut Unpacker<'a>) -> Option<Self::View>;
    fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<Self::ListView>;
}
Expand description

A type read as a view of a frame: what it is borrowed (View), and what a list of it is (ListView).

Required Associated Types§

Required Methods§

Source

fn unpack_view(u: &mut Unpacker<'a>) -> Option<Self::View>

Source

fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<Self::ListView>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, T: View<'a>> View<'a> for Box<T>

Source§

type View = <T as View<'a>>::View

Source§

type ListView = <T as View<'a>>::ListView

Source§

fn unpack_view(u: &mut Unpacker<'a>) -> Option<T::View>

Source§

fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<T::ListView>

Source§

impl<'a, T: View<'a>> View<'a> for Option<T>

Source§

type View = Option<<T as View<'a>>::View>

Source§

type ListView = List<'a, Option<T>>

Source§

fn unpack_view(u: &mut Unpacker<'a>) -> Option<Option<T::View>>

Source§

fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<Self::ListView>

Source§

impl<'a, T: View<'a>> View<'a> for Vec<T>

Source§

type View = <T as View<'a>>::ListView

Source§

type ListView = List<'a, Vec<T>>

Source§

fn unpack_view(u: &mut Unpacker<'a>) -> Option<T::ListView>

Source§

fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<Self::ListView>

Source§

impl<'a> View<'a> for Box<str>

Source§

type View = &'a str

Source§

type ListView = List<'a, Box<str>>

Source§

fn unpack_view(u: &mut Unpacker<'a>) -> Option<&'a str>

Source§

fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<Self::ListView>

Source§

impl<'a> View<'a> for String

Source§

type View = &'a str

Source§

type ListView = List<'a, String>

Source§

fn unpack_view(u: &mut Unpacker<'a>) -> Option<&'a str>

Source§

fn unpack_list_view(u: &mut Unpacker<'a>) -> Option<Self::ListView>

Source§

impl<'a> View<'a> for bool

Source§

impl<'a> View<'a> for f32

Source§

impl<'a> View<'a> for f64

Source§

impl<'a> View<'a> for i8

Source§

impl<'a> View<'a> for i16

Source§

impl<'a> View<'a> for i32

Source§

impl<'a> View<'a> for i64

Source§

impl<'a> View<'a> for u8

Source§

impl<'a> View<'a> for u16

Source§

impl<'a> View<'a> for u32

Source§

impl<'a> View<'a> for u64

Source§

impl<'a> View<'a> for usize

Implementors§