pub enum Reply {
Empty,
Json(Value),
Data(Box<dyn ReplyData>),
List(Vec<Reply>),
}Variants§
Implementations§
Source§impl Reply
impl Reply
pub fn data(data: impl Serialize + Send + Sync + 'static) -> Self
Sourcepub fn shown(&self) -> Option<Shown<'_>>
pub fn shown(&self) -> Option<Shown<'_>>
None when some data is only Serialize: the whole reply then renders from its JSON.
pub fn into_json(self) -> Result<Value>
pub fn to_json(&self) -> Result<Value>
pub fn write_json(&self, out: &mut Vec<u8>) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Reply
impl !UnwindSafe for Reply
impl Freeze for Reply
impl Send for Reply
impl Sync for Reply
impl Unpin for Reply
impl UnsafeUnpin for Reply
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