Skip to main content

Part

Trait Part 

Source
pub trait Part: Sized + 'static {
    const TYPE: &'static str;

    // Required methods
    fn format(self) -> Buffer ;
    fn parse(s: &str) -> Result<Self>;
}
Expand description

Part is a trait for multipart part.

Required Associated Constants§

Source

const TYPE: &'static str

TYPE is the type of multipart.

Current available types are: form-data and mixed

Required Methods§

Source

fn format(self) -> Buffer

format will generates the bytes.

Source

fn parse(s: &str) -> Result<Self>

parse will parse the bytes into a part.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Part for FormDataPart

Source§

const TYPE: &'static str = "form-data"

Source§

impl Part for MixedPart

Source§

const TYPE: &'static str = "mixed"

Source§

impl Part for RelatedPart

Source§

const TYPE: &'static str = "related"