Trait roach::DataTransform

source ·
pub trait DataTransform<'a, I: 'a + ?Sized, D: Direction> {
    type Output;

    // Required method
    fn apply(input: I) -> Result<Self::Output, ArchiveError>;
}
Expand description

Implements the ability to convert archived data to in-memory data, or vice-versa.

Required Associated Types§

source

type Output

The output type of this transformation.

Required Methods§

source

fn apply(input: I) -> Result<Self::Output, ArchiveError>

Attempts to convert the given input type to the output.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> DataTransform<'a, &'a str, ToArchive> for str

§

type Output = &'a [u8]

source§

fn apply(input: &'a str) -> Result<Self::Output, ArchiveError>

source§

impl<'a> DataTransform<'a, &'a [u8], ToArchive> for [u8]

§

type Output = &'a [u8]

source§

fn apply(input: &'a [u8]) -> Result<Self::Output, ArchiveError>

source§

impl<'a> DataTransform<'a, AccessGuard<'a, &'static [u8]>, FromArchive> for str

§

type Output = StringGuard<'a>

source§

fn apply( input: AccessGuard<'a, &'static [u8]> ) -> Result<Self::Output, ArchiveError>

source§

impl<'a> DataTransform<'a, AccessGuard<'a, &'static [u8]>, FromArchive> for [u8]

§

type Output = AccessGuard<'a, &'static [u8]>

source§

fn apply( input: AccessGuard<'a, &'static [u8]> ) -> Result<Self::Output, ArchiveError>

source§

impl<'a, const N: usize> DataTransform<'a, &'a [u8; N], ToArchive> for [u8; N]

§

type Output = &'a [u8; N]

source§

fn apply(input: &'a [u8; N]) -> Result<Self::Output, ArchiveError>

source§

impl<'a, const N: usize> DataTransform<'a, AccessGuard<'a, &'static [u8; N]>, FromArchive> for [u8; N]

§

type Output = AccessGuard<'a, &'static [u8; N]>

source§

fn apply( input: AccessGuard<'a, &'static [u8; N]> ) -> Result<Self::Output, ArchiveError>

Implementors§

source§

impl<'a, I: 'a + BufRead, T: 'a + DataTransform<'a, Decoder<'a, I>, FromArchive> + ?Sized, const LEVEL: u32> DataTransform<'a, I, FromArchive> for Zstd<T, LEVEL>

§

type Output = <T as DataTransform<'a, Decoder<'a, I>, FromArchive>>::Output

source§

impl<'a, I: 'a, T: 'a + DataTransform<'a, I, ToArchive> + ?Sized, const LEVEL: u32> DataTransform<'a, I, ToArchive> for Zstd<T, LEVEL>where T::Output: 'a + ToWriter,

§

type Output = ZstdWrite<<T as DataTransform<'a, I, ToArchive>>::Output, LEVEL>

source§

impl<'a, T: 'a + DataTransform<'a, Decoder<'a, Cursor<AccessGuard<'a, &'static [u8]>>>, FromArchive> + ?Sized, const LEVEL: u32> DataTransform<'a, AccessGuard<'a, &'static [u8]>, FromArchive> for Zstd<T, LEVEL>

§

type Output = <T as DataTransform<'a, Decoder<'a, Cursor<AccessGuard<'a, &'static [u8]>>>, FromArchive>>::Output

source§

impl<'a, T: 'a + Pod + Zeroable> DataTransform<'a, &'a T, ToArchive> for Pod<T>

§

type Output = &'a [u8; { _ }]

source§

impl<'a, T: Serialize + DeserializeOwned> DataTransform<'a, &'a T, ToArchive> for Rmp<T>

§

type Output = SerializeWrite<'a, T>

source§

impl<'a, T: Serialize + DeserializeOwned> DataTransform<'a, AccessGuard<'a, &'static [u8]>, FromArchive> for Rmp<T>

§

type Output = T

source§

impl<'a, T: Serialize + DeserializeOwned, I: 'a + Read> DataTransform<'a, I, FromArchive> for Rmp<T>

§

type Output = T

source§

impl<'a, T: Pod + Zeroable, I: 'a + AsRef<[u8; { _ }]>> DataTransform<'a, I, FromArchive> for Pod<T>

§

type Output = PodGuard<T, I>

source§

impl<'a, const LEVEL: u32> DataTransform<'a, AccessGuard<'a, &'static [u8]>, FromArchive> for Zstd<[u8], LEVEL>

§

type Output = Vec<u8>