pub struct BodyBuilder<T>(/* private fields */);
Expand description
Builder for serializing an instance of the Body type.
Can be created using the Body::builder method.
Implementations§
Source§impl BodyBuilder<Uninitialized>
impl BodyBuilder<Uninitialized>
Sourcepub fn request<T>(self, value: T) -> BodyBuilder<Initialized<1, T>>where
T: WriteAsOffset<Request>,
pub fn request<T>(self, value: T) -> BodyBuilder<Initialized<1, T>>where
T: WriteAsOffset<Request>,
Creates an instance of the Request
variant.
Sourcepub fn response<T>(self, value: T) -> BodyBuilder<Initialized<2, T>>where
T: WriteAsOffset<Response>,
pub fn response<T>(self, value: T) -> BodyBuilder<Initialized<2, T>>where
T: WriteAsOffset<Response>,
Creates an instance of the Response
variant.
Sourcepub fn notification<T>(self, value: T) -> BodyBuilder<Initialized<3, T>>where
T: WriteAsOffset<Notification>,
pub fn notification<T>(self, value: T) -> BodyBuilder<Initialized<3, T>>where
T: WriteAsOffset<Notification>,
Creates an instance of the Notification
variant.
Sourcepub fn log<T>(self, value: T) -> BodyBuilder<Initialized<4, T>>where
T: WriteAsOffset<Log>,
pub fn log<T>(self, value: T) -> BodyBuilder<Initialized<4, T>>where
T: WriteAsOffset<Log>,
Creates an instance of the Log
variant.
Source§impl<const N: u8, T> BodyBuilder<Initialized<N, T>>
impl<const N: u8, T> BodyBuilder<Initialized<N, T>>
Sourcepub fn finish(self, builder: &mut Builder) -> UnionOffset<Body>where
Self: WriteAsUnion<Body>,
pub fn finish(self, builder: &mut Builder) -> UnionOffset<Body>where
Self: WriteAsUnion<Body>,
Finish writing the builder to get an UnionOffset to a serialized Body.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for BodyBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for BodyBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for BodyBuilder<T>where
T: Send,
impl<T> Sync for BodyBuilder<T>where
T: Sync,
impl<T> Unpin for BodyBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for BodyBuilder<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more