pub enum Solution {
Missing,
Value(Value),
}Expand description
Raw solution field from a task response.
Variants§
Missing
The response did not include a solution field.
Value(Value)
The response included a solution value, including JSON null.
Implementations§
Source§impl Solution
impl Solution
Sourcepub const fn is_missing(&self) -> bool
pub const fn is_missing(&self) -> bool
Returns true when the response did not include a solution field.
Sourcepub const fn as_value(&self) -> Option<&Value>
pub const fn as_value(&self) -> Option<&Value>
Returns the raw JSON value when the field was present.
Sourcepub fn into_value(self) -> Option<Value>
pub fn into_value(self) -> Option<Value>
Consumes the wrapper and returns the raw JSON value when present.
Sourcepub fn deserialize<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn deserialize<T>(&self) -> Result<T>where
T: DeserializeOwned,
Deserializes the raw JSON value into a caller-selected type.
The raw value is borrowed, so only the fields T actually reads are
copied and the stored solution remains available afterwards.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Solution
impl<'de> Deserialize<'de> for Solution
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Solution
Auto Trait Implementations§
impl Freeze for Solution
impl RefUnwindSafe for Solution
impl Send for Solution
impl Sync for Solution
impl Unpin for Solution
impl UnsafeUnpin for Solution
impl UnwindSafe for Solution
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