AsContent

Trait AsContent 

Source
pub trait AsContent {
    type Output: Serialize;

    // Required method
    fn as_content(&self) -> Self::Output;
}
Expand description

Trait for converting a type into a serializable message content that conforms to the OpenC2 message content structure. This allows for types such as Message<Command> to be serialized correctly as OpenC2 message contents.

Required Associated Types§

Source

type Output: Serialize

The intermediate type that represents Self in a way that complies with the OpenC2 content structure.

Required Methods§

Source

fn as_content(&self) -> Self::Output

Implementors§

Source§

impl<'a, V: Serialize> AsContent for &'a Content<V>

Source§

type Output = ContentAsContent<'a, V>

Source§

impl<'a, V: Serialize> AsContent for &'a Command<V>

Source§

type Output = CommandAsContent<'a, V>

Source§

impl<'a, V: Serialize> AsContent for &'a Response<V>

Source§

type Output = ResponseAsContent<'a, V>