[][src]Enum multipart::server::save::SavedData

pub enum SavedData {
    Text(String),
    Bytes(Vec<u8>),
    File(PathBufu64),
}

A saved field's data container (in memory or on disk)

Variants

Text(String)

Validated UTF-8 text data.

Bytes(Vec<u8>)

Binary data.

File(PathBufu64)

A path to a file on the filesystem and its size as written by multipart.

Implementations

impl SavedData[src]

pub fn readable(&self) -> Result<DataReader<'_>>[src]

Get an adapter for this data which implements Read.

If the data is in a file, the file is opened in read-only mode.

pub fn size(&self) -> u64[src]

Get the size of the data, in memory or on disk.

Note

The size on disk may not match the size of the file if it is externally modified.

pub fn is_memory(&self) -> bool[src]

Returns true if the data is known to be in memory (Text | Bytes)

Trait Implementations

impl Debug for SavedData[src]

impl From<String> for SavedData[src]

impl From<Vec<u8, Global>> for SavedData[src]

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> DebugAny for T where
    T: Any + Debug

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.

impl<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,