[][src]Struct yukikaze::client::request::multipart::Form

pub struct Form {
    pub boundary: &'static str,
    // some fields omitted
}

Multipart Form.

Default boundary is yuki.

Fields

boundary: &'static str

Boundary to use.

Implementations

impl Form[src]

pub fn new() -> Self[src]

Creates new instance of form.

pub fn with_boundary(boundary: &'static str) -> Self[src]

Creates new instance with provided boundary.

Panic

In debug builds, it asserts whether string contains only ASCII characters or not.

pub fn add_field(&mut self, name: String, data: &[u8])[src]

Adds new field with jsut name.

pub fn add_file_field(
    &mut self,
    field_name: String,
    file_name: String,
    mime: &Mime,
    data: &[u8]
)
[src]

Adds new field with file.

pub fn add_file<P: AsRef<Path>>(
    &mut self,
    field_name: String,
    path: P
) -> Result<()>
[src]

Adds file to the form.

Note

It reads entire file into buffer.

IO Error

If error happens file copying content of file, then content of storage shall be restored to its state before starting the operation.

pub fn finish(self) -> (u64, Bytes)[src]

Finishes creating form and produces body with its length

Auto Trait Implementations

impl RefUnwindSafe for Form

impl Send for Form

impl Sync for Form

impl Unpin for Form

impl UnwindSafe for Form

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> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

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.