pub trait Thing {
// Required method
fn from_value(data: &Value, app: &App) -> Result<Self, Error>
where Self: Sized;
}Expand description
A trait representing a reddit Thing that can be deserialized from JSON
Required Methods§
Sourcefn from_value(data: &Value, app: &App) -> Result<Self, Error>where
Self: Sized,
fn from_value(data: &Value, app: &App) -> Result<Self, Error>where
Self: Sized,
Parses the thing from json
§Arguments
data- A reference to json data to be parsedapp- A reference to a reddit app. This is necessary in case more data is needed to be retrieved in order to completely parse the value
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".