pub enum FacadeResponse {
Success {
content: Content,
warnings: Vec<FacadeProblem>,
},
Partial {
content: Content,
warnings: Vec<FacadeProblem>,
},
Error {
error: FacadeProblem,
},
Cancelled {
warnings: Vec<FacadeProblem>,
},
}Expand description
The public response has exactly one content representation on success/partial, an error on failure, and no content on cancellation. Constructors and strict deserialization enforce this invariant on both sides of the wire.
Variants§
Implementations§
Source§impl FacadeResponse
impl FacadeResponse
pub fn cancelled() -> Self
pub fn success(data: Value) -> Self
pub fn partial(data: Value) -> Self
pub fn error(code: impl Into<String>, message: impl Into<String>) -> Self
pub fn with_details(self, details: Value) -> Self
pub fn status(&self) -> FacadeStatus
pub fn is_error(&self) -> bool
pub fn data(&self) -> Option<&Value>
pub fn data_mut(&mut self) -> Option<&mut Value>
Sourcepub fn with_text(self, text: String) -> Self
pub fn with_text(self, text: String) -> Self
Presentation never changes execution outcome or discards warnings.
pub fn with_warning(self, warning: FacadeProblem) -> Self
Trait Implementations§
Source§impl Clone for FacadeResponse
impl Clone for FacadeResponse
Source§impl Debug for FacadeResponse
impl Debug for FacadeResponse
Source§impl<'de> Deserialize<'de> for FacadeResponse
impl<'de> Deserialize<'de> for FacadeResponse
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FacadeResponse
impl PartialEq for FacadeResponse
Source§impl Serialize for FacadeResponse
impl Serialize for FacadeResponse
impl StructuralPartialEq for FacadeResponse
Auto Trait Implementations§
impl Freeze for FacadeResponse
impl RefUnwindSafe for FacadeResponse
impl Send for FacadeResponse
impl Sync for FacadeResponse
impl Unpin for FacadeResponse
impl UnsafeUnpin for FacadeResponse
impl UnwindSafe for FacadeResponse
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