Skip to main content

FromUnproved

Trait FromUnproved 

Source
pub trait FromUnproved<Req> {
    type Request;
    type Response;

    // Required method
    fn maybe_from_unproved_with_metadata<I: Into<Self::Request>, O: Into<Self::Response>>(
        request: I,
        response: O,
        network: Network,
        platform_version: &PlatformVersion,
    ) -> Result<(Option<Self>, ResponseMetadata), Error>
       where Self: Sized;

    // Provided methods
    fn maybe_from_unproved<I: Into<Self::Request>, O: Into<Self::Response>>(
        request: I,
        response: O,
        network: Network,
        platform_version: &PlatformVersion,
    ) -> Result<Option<Self>, Error>
       where Self: Sized { ... }
    fn from_unproved<I: Into<Self::Request>, O: Into<Self::Response>>(
        request: I,
        response: O,
        network: Network,
        platform_version: &PlatformVersion,
    ) -> Result<Self, Error>
       where Self: Sized { ... }
    fn from_unproved_with_metadata<I: Into<Self::Request>, O: Into<Self::Response>>(
        request: I,
        response: O,
        network: Network,
        platform_version: &PlatformVersion,
    ) -> Result<(Self, ResponseMetadata), Error>
       where Self: Sized { ... }
}
Expand description

Trait for parsing unproved responses from the Platform.

This trait defines methods for extracting data from responses received from the Platform without the need for cryptographic proof validation. It is primarily used for scenarios where the proof data is not available or not required, and only the data itself is needed.

§Associated Types

  • Request: The type of the request sent to the server. This represents the format of the data that the platform expects when making a query.
  • Response: The type of the response received from the server. This represents the format of the data returned by the platform after executing the query.

§Methods

  • maybe_from_unproved: Parses the response to retrieve the requested object, if any.
  • maybe_from_unproved_with_metadata: Parses the response to retrieve the requested object along with response metadata, if any.
  • from_unproved: Retrieves the requested object from the response, returning an error if the object is not found.
  • from_unproved_with_metadata: Retrieves the requested object from the response along with metadata, returning an error if the object is not found.

Required Associated Types§

Source

type Request

Request type for which this trait is implemented.

Source

type Response

Response type for which this trait is implemented.

Required Methods§

Source

fn maybe_from_unproved_with_metadata<I: Into<Self::Request>, O: Into<Self::Response>>( request: I, response: O, network: Network, platform_version: &PlatformVersion, ) -> Result<(Option<Self>, ResponseMetadata), Error>
where Self: Sized,

Parse the received response and retrieve the requested object along with metadata, if any.

§Arguments
  • request: The request sent to the server.
  • response: The response received from the server.
  • network: The network we are using (Mainnet/Testnet/Devnet/Regtest).
  • platform_version: The platform version that should be used.
§Returns
  • Ok((Some(object), metadata)) when the requested object was found.
  • Ok((None, metadata)) when the requested object was not found.
  • Err(Error) when parsing fails or data is invalid.

Provided Methods§

Source

fn maybe_from_unproved<I: Into<Self::Request>, O: Into<Self::Response>>( request: I, response: O, network: Network, platform_version: &PlatformVersion, ) -> Result<Option<Self>, Error>
where Self: Sized,

Parse the received response and retrieve the requested object, if any.

§Arguments
  • request: The request sent to the server.
  • response: The response received from the server.
  • network: The network we are using (Mainnet/Testnet/Devnet/Regtest).
  • platform_version: The platform version that should be used.
§Returns
  • Ok(Some(object)) when the requested object was found in the response.
  • Ok(None) when the requested object was not found.
  • Err(Error) when parsing fails or data is invalid.
Source

fn from_unproved<I: Into<Self::Request>, O: Into<Self::Response>>( request: I, response: O, network: Network, platform_version: &PlatformVersion, ) -> Result<Self, Error>
where Self: Sized,

Retrieve the requested object from the response.

§Arguments
  • request: The request sent to the server.
  • response: The response received from the server.
  • network: The network we are using.
  • platform_version: The platform version that should be used.
§Returns
  • Ok(object) when the requested object was found.
  • Err(Error::NotFound) when the requested object was not found.
  • Err(Error) when parsing fails or data is invalid.
Source

fn from_unproved_with_metadata<I: Into<Self::Request>, O: Into<Self::Response>>( request: I, response: O, network: Network, platform_version: &PlatformVersion, ) -> Result<(Self, ResponseMetadata), Error>
where Self: Sized,

Retrieve the requested object from the response along with metadata.

§Arguments
  • request: The request sent to the server.
  • response: The response received from the server.
  • network: The network we are using.
  • platform_version: The platform version that should be used.
§Returns
  • Ok((object, metadata)) when the requested object was found.
  • Err(Error::NotFound) when the requested object was not found.
  • Err(Error) when parsing fails or data is invalid.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl FromUnproved<GetContractDocumentRemovalsRequest> for ContractDocumentRemovals

Source§

type Request = GetContractDocumentRemovalsRequest

Source§

type Response = GetContractDocumentRemovalsResponse

Source§

impl FromUnproved<GetContractFeePotsRequest> for ContractFeePots

Source§

type Request = GetContractFeePotsRequest

Source§

type Response = GetContractFeePotsResponse

Source§

impl FromUnproved<GetContractGroupInfoRequest> for ContractGroupInfo

Source§

type Request = GetContractGroupInfoRequest

Source§

type Response = GetContractGroupInfoResponse

Source§

impl FromUnproved<GetContractGroupMembersRequest> for ContractGroupMembersPage

Source§

type Request = GetContractGroupMembersRequest

Source§

type Response = GetContractGroupMembersResponse

Source§

impl FromUnproved<GetContractGroupsForContractRequest> for ContractGroupMembershipsForContract

Source§

type Request = GetContractGroupsForContractRequest

Source§

type Response = GetContractGroupsForContractResponse

Source§

impl FromUnproved<GetContractModerationActionCountsRequest> for ContractModerationActionCounts

Source§

type Request = GetContractModerationActionCountsRequest

Source§

type Response = GetContractModerationActionCountsResponse

Source§

impl FromUnproved<GetContractModerationEntriesRequest> for ContractModerationEntries

Source§

type Request = GetContractModerationEntriesRequest

Source§

type Response = GetContractModerationEntriesResponse

Source§

impl FromUnproved<GetContractModerationStatusRequest> for ContractModerationListStatuses

Source§

type Request = GetContractModerationStatusRequest

Source§

type Response = GetContractModerationStatusResponse

Source§

impl FromUnproved<GetContractTeamActionSignersRequest> for ContractTeamActionSigners

Source§

type Request = GetContractTeamActionSignersRequest

Source§

type Response = GetContractTeamActionSignersResponse

Source§

impl FromUnproved<GetContractTeamActionsRequest> for ContractTeamActions

Source§

type Request = GetContractTeamActionsRequest

Source§

type Response = GetContractTeamActionsResponse

Source§

impl FromUnproved<GetCurrentQuorumsInfoRequest> for CurrentQuorumsInfo

Source§

type Request = GetCurrentQuorumsInfoRequest

Source§

type Response = GetCurrentQuorumsInfoResponse

Source§

impl FromUnproved<GetDataContractsLatestVersionsRequest> for DataContractsLatestVersions

Source§

type Request = GetDataContractsLatestVersionsRequest

Source§

type Response = GetDataContractsLatestVersionsResponse

Source§

impl FromUnproved<GetIdentityKeysRemainingBudgetsRequest> for IdentityKeysRemainingBudgets

Source§

type Request = GetIdentityKeysRemainingBudgetsRequest

Source§

type Response = GetIdentityKeysRemainingBudgetsResponse

Source§

impl FromUnproved<GetStatusRequest> for EvoNodeStatus

Source§

type Request = GetStatusRequest

Source§

type Response = GetStatusResponse