Skip to main content

Part

Trait Part 

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

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

Part is a trait for multipart part.

Required Associated Constants§

const TYPE: &'static str

TYPE is the type of multipart.

Current available types are: form-data and mixed

Required Methods§

fn format(self) -> Buffer

format will generates the bytes.

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

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", so this trait is not object safe.

Implementors§

§

impl Part for FormDataPart

§

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

§

impl Part for MixedPart

§

const TYPE: &'static str = "mixed"

§

impl Part for RelatedPart

§

const TYPE: &'static str = "related"