pub trait TryFromRequest<T>: Sized {
// Required methods
fn try_from_request(grpc_request: T) -> Result<Self, Error>;
fn try_to_request(&self) -> Result<T, Error>;
}Expand description
Convert a gRPC request into a query object.
This trait is implemented on Drive queries that can be created from gRPC requests.
§Generic Type Parameters
T: The type of the gRPC request.
Required Methods§
Sourcefn try_from_request(grpc_request: T) -> Result<Self, Error>
fn try_from_request(grpc_request: T) -> Result<Self, Error>
Create based on some grpc_request.
Sourcefn try_to_request(&self) -> Result<T, Error>
fn try_to_request(&self) -> Result<T, Error>
Try to convert the request into a gRPC query.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.