Struct pagerduty::integration::Context [] [src]

pub struct Context<'a> {
    // some fields omitted
}

An informational asset attached to the incident

This Context type is really a union of two different types, Image and Link. Due to object safety issues, it's not possible to have a Context trait that can be serialized with Serde.

In the case that Context is an image, it must have a src attribute and may optionally have an href and alt attributes. In the case of a link, context must have href and may optionally include text. To enforce these invariants, all of the fields are kept private, and all of the properties must be specifed at once using thelinkandimage` methods.

Methods

impl<'a> Context<'a>

Create a link context object

fn image<S>(src: S, href: Option<S>, alt: Option<S>) -> Context<'a> where S: Into<Cow<'a, str>>

Create an image context object

Trait Implementations

impl<'a> Serialize for Context<'a>

fn serialize<__S>(&self, serializer: &mut __S) -> Result<(), __S::Error> where __S: Serializer

Derived Implementations

impl<'a> Debug for Context<'a>

fn fmt(&self, arg_0: &mut Formatter) -> Result