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>
fn link<S>(href: S, text: S) -> Context<'a> where S: Into<Cow<'a, str>>
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