[][src]Struct siren_types::Action

pub struct Action {
    pub name: String,
    pub class: Vec<String>,
    pub method: Option<Method>,
    pub href: String,
    pub title: Option<String>,
    pub _type: Option<String>,
    pub fields: Vec<Field>,
}

Fields

name: String

A string that identifies the action to be performed. Action names MUST be unique within the set of actions for an entity. The behaviour of clients when parsing a Siren document that violates this constraint is undefined. Required.

class: Vec<String>

Describes the nature of an action based on the current representation. Possible values are implementation-dependent and should be documented. MUST be an array of strings. Optional.

method: Option<Method>

An enumerated attribute mapping to a protocol method. For HTTP, these values may be GET, PUT, POST, DELETE, or PATCH. As new methods are introduced, this list can be extended. If this attribute is omitted, GET should be assumed. Optional.

href: String

The URI of the action. Required.

title: Option<String>

Descriptive text about the action. Optional.

_type: Option<String>

The encoding type for the request. When omitted and the fields attribute exists, the default value is application/x-www-form-urlencoded. Optional.

fields: Vec<Field>

A collection of fields, expressed as an array of objects in JSON Siren such as { "fields" : [{ ... }] }. See Fields. Optional.

Trait Implementations

impl Debug for Action[src]

impl<'de> Deserialize<'de> for Action[src]

impl Serialize for Action[src]

Auto Trait Implementations

impl RefUnwindSafe for Action

impl Send for Action

impl Sync for Action

impl Unpin for Action

impl UnwindSafe for Action

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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.