pub struct Content(/* private fields */);Expand description
An item’s content as a typed client reads it (PERF.115-36): the JSON text
the wire carried, decoded straight into the method’s event when it is
read, never into a Value first. A transport that has no text (one in
process, a script) hands over the Value it holds.
Implementations§
Source§impl Content
impl Content
Sourcepub fn as_text(&self) -> Option<&str>
pub fn as_text(&self) -> Option<&str>
The JSON text the wire carried, when the transport kept it.
Sourcepub fn decode<E: DeserializeOwned>(self) -> Result<E, Error>
pub fn decode<E: DeserializeOwned>(self) -> Result<E, Error>
The content decoded into E: from the text, or from the Value.
Sourcepub fn into_value(self) -> Result<Value, Error>
pub fn into_value(self) -> Result<Value, Error>
The content as a Value, for a caller that wants one.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Content
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnsafeUnpin for Content
impl UnwindSafe for Content
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