[][src]Struct rkyv::CopyResolver

pub struct CopyResolver;

A resolver that always resolves to the unarchived value. This can be useful while implementing ArchiveCopy.

Examples

use rkyv::{Archive, ArchiveCopy, CopyResolver, Write};

#[derive(Clone, Copy)]
struct Example {
    a: i32,
    b: bool,
}

impl Archive for Example {
    type Archived = Example;
    type Resolver = CopyResolver;

    fn archive<W: Write + ?Sized>(&self, writer: &mut W) -> Result<Self::Resolver, W::Error> {
        Ok(CopyResolver)
    }
}

unsafe impl ArchiveCopy for Example {}

Trait Implementations

impl<T: ArchiveCopy> Resolve<T> for CopyResolver[src]

type Archived = T

The type that this resolver resolves to.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.