Trait HasOptionalBody

Source
pub trait HasOptionalBody {
    type Body;

    // Required methods
    fn body(&self) -> Option<&Self::Body>;
    fn body_mut(&mut self) -> Option<&mut Self::Body>;
    fn set_body(&mut self, body: Self::Body);
    fn unset_body(&mut self);

    // Provided methods
    fn with_body(self, body: Self::Body) -> Self
       where Self: Sized { ... }
    fn has_body(&self) -> bool { ... }
}
Expand description

This trait is implemented by types that have a distinct, but optional, body type.

Required Associated Types§

Source

type Body

This type is the particular body for the enclosing type.

Required Methods§

Source

fn body(&self) -> Option<&Self::Body>

Source

fn body_mut(&mut self) -> Option<&mut Self::Body>

Source

fn set_body(&mut self, body: Self::Body)

Source

fn unset_body(&mut self)

Provided Methods§

Source

fn with_body(self, body: Self::Body) -> Self
where Self: Sized,

Source

fn has_body(&self) -> bool

Implementors§