Trait HasBody

Source
pub trait HasBody {
    type Body;

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

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

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

Required Associated Types§

Source

type Body

This type is the particular body for the enclosing type.

Required Methods§

Source

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

Get the body of the enclosing type.

Source

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

Get a mutable reference to the body of the enclosing type.

Source

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

Set the body of the enclosing type.

Provided Methods§

Source

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

Implementors§