[][src]Struct stdweb::web::FormData

pub struct FormData(_);

The FormData interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".

(JavaScript docs)

Methods

impl FormData[src]

pub fn new() -> Self[src]

Creates a new FormData.

(JavaScript docs)

pub fn from_element<T>(form: &T) -> Result<Self, FormDataFromElementError> where
    T: IElement
[src]

Creates a new FormData from a form element.

(JavaScript docs)

pub fn append_string(&self, name: &str, value: &str)[src]

Appends a new value onto an existing key, or adds the key if it does not already exist.

(JavaScript docs)

pub fn append_blob<T>(&self, name: &str, value: &T, filename: Option<&str>) where
    T: IBlob
[src]

Appends a new blob onto an existing key, or adds the key if it does not already exist.

(JavaScript docs)

pub fn delete(&self, name: &str)[src]

pub fn get(&self, name: &str) -> Option<FormDataEntry>[src]

Deletes a key and its value(s).

(JavaScript docs)

pub fn get_all(&self, name: &str) -> Vec<FormDataEntry>[src]

Returns all the values associated with a given key.

(JavaScript docs)

pub fn has(&self, name: &str) -> bool[src]

Returns a boolean stating whether a FormData object contains a certain key.

(JavaScript docs)

pub fn set_string(&self, name: &str, value: &str)[src]

Sets a new value for an existing key, or adds the key/value if it does not already exist.

(JavaScript docs)

pub fn set_blob<T>(&self, name: &str, value: &T, filename: Option<&str>) where
    T: IBlob
[src]

Sets a new blob for an existing key, or adds the key/value if it does not already exist.

(JavaScript docs)

Trait Implementations

impl JsSerialize for FormData[src]

impl TryFrom<FormData> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for FormData[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for FormData[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for FormData[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for FormData[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for FormData[src]

impl ReferenceType for FormData[src]

impl AsRef<Reference> for FormData[src]

impl From<FormData> for Reference[src]

impl Clone for FormData[src]

impl Eq for FormData[src]

impl PartialEq<FormData> for FormData[src]

impl Debug for FormData[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]