TryFromRequest

Trait TryFromRequest 

Source
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§

Source

fn try_from_request(grpc_request: T) -> Result<Self, Error>

Create based on some grpc_request.

Source

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.

Implementations on Foreign Types§

Source§

impl TryFromRequest<ResultType> for ContestedDocumentVotePollDriveQueryResultType

Source§

impl TryFromRequest<GetContestedResourceIdentityVotesRequest> for ContestedResourceVotesGivenByIdentityQuery

Source§

impl TryFromRequest<GetContestedResourceVoteStateRequest> for ContestedDocumentVotePollDriveQuery

Source§

impl TryFromRequest<GetContestedResourceVotersForIdentityRequest> for ContestedDocumentVotePollVotesDriveQuery

Source§

impl TryFromRequest<GetContestedResourcesRequest> for VotePollsByDocumentTypeQuery

Source§

impl TryFromRequest<GetPrefundedSpecializedBalanceRequest> for Identifier

Source§

impl TryFromRequest<GetVotePollsByEndDateRequest> for VotePollsByEndDateDriveQuery

Implementors§