[][src]Struct pact_matching::models::message::Message

pub struct Message {
    pub description: String,
    pub provider_state: Option<String>,
    pub contents: OptionalBody,
    pub metadata: HashMap<String, String>,
    pub matching_rules: MatchingRules,
}

Struct that defines a message.

Fields

description: String

Description of this message interaction. This needs to be unique in the pact file.

provider_state: Option<String>

Optional provider state for the interaction. See http://docs.pact.io/documentation/provider_states.html for more info on provider states.

contents: OptionalBody

The contents of the message

metadata: HashMap<String, String>

Metadata associated with this message.

matching_rules: MatchingRules

Matching rules

Methods

impl Message[src]

pub fn default() -> Message[src]

Returns a default message

pub fn from_json(
    index: usize,
    json: &Value,
    spec_version: &PactSpecification
) -> Result<Message, String>
[src]

Constructs a Message from the Json struct.

pub fn mimetype(&self) -> String[src]

Determins the content type of the message

Trait Implementations

impl Clone for Message[src]

impl Debug for Message[src]

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

impl Eq for Message[src]

impl PartialEq<Message> for Message[src]

impl Serialize for Message[src]

impl StructuralEq for Message[src]

impl StructuralPartialEq for Message[src]

Auto Trait Implementations

impl RefUnwindSafe for Message

impl Send for Message

impl Sync for Message

impl Unpin for Message

impl UnwindSafe for Message

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<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 = !

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, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err