pub struct Reply {
pub status: ReplyStatus,
pub response: Payload,
}Expand description
Correlated Phoenix reply status and response payload.
Fields§
§status: ReplyStatusPhoenix ok or error reply status.
response: PayloadJSON or binary response payload.
Implementations§
Source§impl Reply
impl Reply
Sourcepub fn deserialize<T: DeserializeOwned>(&self) -> Result<T, PayloadError>
pub fn deserialize<T: DeserializeOwned>(&self) -> Result<T, PayloadError>
Deserializes the response when it is JSON, regardless of reply status.
Sourcepub fn into_result(self) -> Result<Payload, Payload>
pub fn into_result(self) -> Result<Payload, Payload>
Converts an ok reply to Ok and an error reply to Err.
Sourcepub fn deserialize_ok<T: DeserializeOwned>(self) -> Result<T, ReplyError>
pub fn deserialize_ok<T: DeserializeOwned>(self) -> Result<T, ReplyError>
Requires an ok status and deserializes its JSON response.
Trait Implementations§
impl StructuralPartialEq for Reply
Auto Trait Implementations§
impl Freeze for Reply
impl RefUnwindSafe for Reply
impl Send for Reply
impl Sync for Reply
impl Unpin for Reply
impl UnsafeUnpin for Reply
impl UnwindSafe 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