Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Client for Monaco Protocol API

REST API for the Monaco Protocol hybrid CLOB exchange.

Version: 1.0.0

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str) -> Self

Create a new client.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source

pub fn new_with_client(baseurl: &str, client: Client) -> Self

Construct a new client with an existing reqwest::Client, allowing more control over its configuration.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source§

impl Client

Source

pub async fn get_user_balances<'a>( &'a self, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, ) -> Result<ResponseValue<GetBalancesResponse>, Error<()>>

Get user balances

Get user balances.

Get the current user’s token balances with pagination support. Returns available, locked, and total balance for each token.

Sends a GET request to /api/v1/accounts/balances

Arguments:

  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
Source

pub async fn get_user_balance_by_asset<'a>( &'a self, asset_id: &'a str, ) -> Result<ResponseValue<GetBalanceByAssetResponse>, Error<()>>

Get user balance by asset

Get user balance by asset.

Get the current user’s balance for a specific asset. Returns available, locked, and total balance. If no balance exists for a valid asset, returns zero balances. If the asset ID is invalid or not found, returns 404.

Sends a GET request to /api/v1/accounts/balances/{asset_id}

Source

pub async fn get_user_profile<'a>( &'a self, ) -> Result<ResponseValue<GetProfileResponse>, Error<()>>

Get user profile

Get user profile.

Get the current user’s profile with token balances, recent movements, and recent orders. Use source to control data source: hot_storage (fast, real-time), cold_storage (historical), or both (hybrid).

Sends a GET request to /api/v1/accounts/me

Source

pub async fn get_portfolio_stats<'a>( &'a self, period: Option<&'a str>, ) -> Result<ResponseValue<GetPortfolioStatsResponse>, Error<()>>

Get portfolio stats

Get portfolio stats.

Get aggregate portfolio statistics for the authenticated user, scoped by time period. Includes volume, PnL, fees, equity, and win/loss metrics.

Sends a GET request to /api/v1/accounts/me/portfolio

Source

pub async fn get_portfolio_chart<'a>( &'a self, metric: Option<&'a str>, period: Option<&'a str>, ) -> Result<ResponseValue<GetPortfolioChartResponse>, Error<()>>

Get portfolio chart time series

Get portfolio chart time series.

Get bucketed time series data for portfolio charts. Supports volume and PnL metrics with configurable time periods and automatic bucket sizing.

Sends a GET request to /api/v1/accounts/me/portfolio/chart

Source

pub async fn get_user_movements<'a>( &'a self, asset_id: Option<&'a Uuid>, entry_type: Option<GetUserMovementsEntryType>, order_by: Option<GetUserMovementsOrderBy>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, transaction_type: Option<GetUserMovementsTransactionType>, ) -> Result<ResponseValue<GetMovementsResponse>, Error<()>>

Get user movements

Get user movements.

Get the current user’s ledger movements (transaction history) with pagination and filtering support.

Sends a GET request to /api/v1/accounts/movements

Arguments:

  • asset_id: Asset identifier (UUID)
  • entry_type: Ledger entry type
  • order_by: Sort direction for created_at
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • transaction_type: Transaction type
Source

pub async fn list_sub_accounts_with_balances<'a>( &'a self, ) -> Result<ResponseValue<ListSubAccountsResponse>, Error<()>>

List sub-accounts with balances

List sub-accounts with balances.

List all sub-accounts with their token balances for a master account. Only returns sub-accounts that belong to the same application as the requesting user.

Sends a GET request to /api/v1/accounts/sub-accounts

Source

pub async fn create_sub_account_limit<'a>( &'a self, body: &'a CreateLimitRequest, ) -> Result<ResponseValue<CreateLimitResponse>, Error<()>>

Create sub-account limit

Create sub-account limit.

Create a new limit for a sub-account. Only master accounts can create limits for their sub-accounts.

Sends a POST request to /api/v1/accounts/sub-accounts/limits

Source

pub async fn get_sub_account_limits<'a>( &'a self, sub_account_id: &'a str, ) -> Result<ResponseValue<GetLimitsResponse>, Error<()>>

Get sub-account limits

Get sub-account limits.

Get all limits for a sub-account. Users can only view limits for their own accounts or their sub-accounts.

Sends a GET request to /api/v1/accounts/sub-accounts/{sub_account_id}/limits

Source

pub async fn update_sub_account_limit<'a>( &'a self, sub_account_id: &'a str, asset_id: &'a str, body: &'a UpdateLimitRequest, ) -> Result<ResponseValue<UpdateLimitResponse>, Error<()>>

Update sub-account limit

Update sub-account limit.

Update an existing limit for a sub-account. Only master accounts can update limits for their sub-accounts.

Sends a PUT request to /api/v1/accounts/sub-accounts/{sub_account_id}/limits/{asset_id}

Source

pub async fn delete_sub_account_limit<'a>( &'a self, sub_account_id: &'a str, asset_id: &'a str, limit_id: Option<&'a Uuid>, ) -> Result<ResponseValue<DeleteLimitResponse>, Error<()>>

Delete sub-account limit

Delete sub-account limit.

Delete a limit for a sub-account. Only master accounts can delete limits for their sub-accounts.

Sends a DELETE request to /api/v1/accounts/sub-accounts/{sub_account_id}/limits/{asset_id}

Arguments:

  • sub_account_id
  • asset_id
  • limit_id: Limit identifier (UUID)
Source

pub async fn get_user_trades<'a>( &'a self, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, trading_pair_id: Option<&'a Uuid>, ) -> Result<ResponseValue<GetUserTradesResponse>, Error<()>>

Get user trade history

Get user trades.

Get the authenticated user’s trade history with pagination. Returns trades where the user was either maker or taker, with user-specific side and fee information.

Sends a GET request to /api/v1/accounts/trades

Arguments:

  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • trading_pair_id: Trading pair identifier (UUID)
Source

pub async fn list_application_balances<'a>( &'a self, asset_id: Option<&'a Uuid>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, user_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListAppBalancesResponse>, Error<()>>

List application balances

List application balances.

Returns a paginated list of all user balances for this application. Requires backend authentication via secret key.

Sends a GET request to /api/v1/applications/balances

Arguments:

  • asset_id: Asset identifier (UUID)
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • user_id: User identifier (UUID)
Source

pub async fn get_application_config<'a>( &'a self, ) -> Result<ResponseValue<GetConfigResponse>, Error<()>>

Get application configuration

Get application configuration.

Returns the configuration for the authenticated application including allowed origins, webhook URL, and vault contract address.

Sends a GET request to /api/v1/applications/config

Source

pub async fn list_application_movements<'a>( &'a self, asset_id: Option<&'a Uuid>, entry_type: Option<ListApplicationMovementsEntryType>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, transaction_type: Option<ListApplicationMovementsTransactionType>, user_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListAppMovementsResponse>, Error<()>>

List application movements

List application movements.

Returns a paginated list of all ledger movements (deposits, withdrawals, trades, etc.) for this application. Requires backend authentication via secret key.

Sends a GET request to /api/v1/applications/movements

Arguments:

  • asset_id: Asset identifier (UUID)
  • entry_type: Ledger entry type
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • transaction_type: Transaction type
  • user_id: User identifier (UUID)
Source

pub async fn list_application_orders<'a>( &'a self, order_type: Option<ListApplicationOrdersOrderType>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, side: Option<ListApplicationOrdersSide>, status: Option<&'a ListApplicationOrdersStatus>, trading_pair_id: Option<&'a Uuid>, user_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListAppOrdersResponse>, Error<()>>

List application orders

List application orders.

Returns a paginated list of all orders for this application. Requires backend authentication via secret key.

Sends a GET request to /api/v1/applications/orders

Arguments:

  • order_type: Order type
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • side: Order side
  • status: Order status (single value or comma-separated list)
  • trading_pair_id: Trading pair identifier (UUID)
  • user_id: User identifier (UUID)
Source

pub async fn list_application_users<'a>( &'a self, account_type: Option<ListApplicationUsersAccountType>, address: &'a ListApplicationUsersAddress, is_active: Option<bool>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, ) -> Result<ResponseValue<ListAppUsersResponse>, Error<()>>

List application users

List application users.

Returns a paginated list of all users for this application. Requires backend authentication via secret key.

Sends a GET request to /api/v1/applications/users

Arguments:

  • account_type: Account type filter
  • address: Wallet address
  • is_active
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
Source

pub async fn authenticate_backend<'a>( &'a self, body: &'a BackendAuthRequest, ) -> Result<ResponseValue<BackendAuthResponse>, Error<()>>

Backend service authentication

Backend service authentication.

Authenticate a backend service using a secret key. Returns a long-lived access token for server-to-server API access.

Sends a POST request to /api/v1/auth/backend

Source

pub async fn create_challenge<'a>( &'a self, body: &'a ChallengeRequest, ) -> Result<ResponseValue<ChallengeResponse>, Error<()>>

Create authentication challenge

Create authentication challenge.

Generate a cryptographic challenge (nonce) for wallet-based authentication. The user must sign the returned message with their private key to prove ownership of the wallet.

Sends a POST request to /api/v1/auth/challenge

Source

pub async fn refresh_token<'a>( &'a self, body: &'a RefreshRequest, ) -> Result<ResponseValue<RefreshResponse>, Error<()>>

Refresh access token

Refresh access token.

Generate a new access token using a valid refresh token. The refresh token remains valid for future use.

Sends a POST request to /api/v1/auth/refresh

Source

pub async fn revoke_session<'a>( &'a self, body: &'a RevokeRequest, ) -> Result<ResponseValue<RevokeResponse>, Error<()>>

Revoke current session

Revoke current session.

Revoke the current authenticated session, invalidating the access token. The user will need to authenticate again.

Sends a POST request to /api/v1/auth/revoke

Source

pub async fn verify_signature<'a>( &'a self, body: &'a VerifyRequest, ) -> Result<ResponseValue<VerifyResponse>, Error<()>>

Verify signature and authenticate

Verify signature and authenticate.

Verify the signed challenge message and create an authenticated session. Returns JWT tokens for subsequent API access.

Sends a POST request to /api/v1/auth/verify

Source

pub async fn mint_tokens<'a>( &'a self, ) -> Result<ResponseValue<MintTokensResponse>, Error<()>>

Mint all testnet tokens

Mint all testnet tokens.

Mint all available testnet tokens to the authenticated user’s address. Rate limited per 24 hours.

Sends a POST request to /api/v1/faucet/mint

Source

pub async fn simulate_fees<'a>( &'a self, order_type: Option<SimulateFeesOrderType>, price: &'a SimulateFeesPrice, quantity: &'a SimulateFeesQuantity, side: SimulateFeesSide, slippage_tolerance_bps: Option<i32>, trading_pair_id: &'a Uuid, ) -> Result<ResponseValue<SimulateFeesResponse>, Error<()>>

Simulate fees for a potential order

Simulate fees for a potential order.

Returns exact fee breakdown for a specific order before placing it, including Monaco protocol fees, application fees, total amounts, and the maximum quantity affordable at the given price.

Sends a GET request to /api/v1/fees/simulate

Arguments:

  • order_type: Order type
  • price: Price as decimal string
  • quantity: Quantity as decimal string
  • side: Order side
  • slippage_tolerance_bps
  • trading_pair_id: Trading pair identifier (UUID)
Source

pub async fn list_trading_pairs<'a>( &'a self, base_token: Option<&'a str>, is_active: Option<bool>, market_type: Option<ListTradingPairsMarketType>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, quote_token: Option<&'a str>, ) -> Result<ResponseValue<ListTradingPairsResponse>, Error<()>>

Trading Pairs

Trading Pairs

Get paginated list of trading pairs with optional filtering by market type, base token, quote token, and active status.

Sends a GET request to /api/v1/market/pairs

Arguments:

  • base_token
  • is_active
  • market_type: Filter by market type
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • quote_token
Source

pub async fn get_candles<'a>( &'a self, trading_pair_id: &'a str, interval: &'a str, end_time: Option<i64>, limit: Option<NonZeroU32>, start_time: Option<i64>, ) -> Result<ResponseValue<GetCandlesResponse>, Error<()>>

Candlestick Data

Candlestick Data

Get OHLCV (Open, High, Low, Close, Volume) candlestick data for a trading pair with configurable interval and time range.

Sends a GET request to /api/v1/market/pairs/charts/candlestick/{trading_pair_id}/{interval}

Arguments:

  • trading_pair_id
  • interval
  • end_time: End time as Unix timestamp (milliseconds)
  • limit: Max candles to return (max 1000)
  • start_time: Start time as Unix timestamp (milliseconds)
Source

pub async fn get_trading_pair_by_id<'a>( &'a self, trading_pair_id: &'a str, ) -> Result<ResponseValue<GetTradingPairResponse>, Error<()>>

Trading Pair By ID

Trading Pair By ID

Get a specific trading pair by its UUID.

Sends a GET request to /api/v1/market/pairs/{trading_pair_id}

Source

pub async fn get_market_metadata<'a>( &'a self, trading_pair_id: &'a str, ) -> Result<ResponseValue<GetMarketMetadataResponse>, Error<()>>

Market Metadata

Market Metadata

Returns current price (from latest candle), 24h statistics (high, low, volume, change), and market initialization timestamp. 24h fields will be null if less than 24 hours of data available.

Sends a GET request to /api/v1/market/pairs/{trading_pair_id}/metadata

Source

pub async fn get_orderbook_snapshot<'a>( &'a self, trading_pair_id: &'a str, denomination: Option<GetOrderbookSnapshotDenomination>, levels: Option<NonZeroU32>, magnitude: Option<GetOrderbookSnapshotMagnitude>, trading_mode: Option<GetOrderbookSnapshotTradingMode>, ) -> Result<ResponseValue<GetOrderbookResponse>, Error<()>>

Orderbook Snapshot

Orderbook Snapshot

Get the complete orderbook snapshot for a trading pair showing all bids and asks with their price levels. This is a public endpoint that does not require authentication.

Sends a GET request to /api/v1/orderbook/{trading_pair_id}

Arguments:

  • trading_pair_id
  • denomination: Price denomination
  • levels: Number of price levels (max 100)
  • magnitude: Price grouping magnitude
  • trading_mode: Trading mode
Source

pub async fn get_orders<'a>( &'a self, order_by: Option<GetOrdersOrderBy>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, status: Option<&'a GetOrdersStatus>, trading_pair_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListOrdersResponse>, Error<()>>

Get user orders

Get user orders.

Get orders for the authenticated user with pagination and optional filtering by status and trading pair.

Sends a GET request to /api/v1/orders

Arguments:

  • order_by: Sort direction for created_at
  • page: Page number (1-indexed)
  • page_size: Items per page (max 100)
  • status: Order status (single value or comma-separated list)
  • trading_pair_id: Trading pair identifier (UUID)
Source

pub async fn create_order<'a>( &'a self, body: &'a CreateOrderRequest, ) -> Result<ResponseValue<CreateOrderResponse>, Error<()>>

Create new order

Create new order.

Create a new order and process it through the matching engine. The order will be matched against existing orders in the orderbook.

Sends a POST request to /api/v1/orders

Source

pub async fn batch_cancel_orders<'a>( &'a self, body: &'a BatchCancelOrdersRequest, ) -> Result<ResponseValue<BatchCancelOrdersResponse>, Error<()>>

Batch cancel specific orders

Batch cancel specific orders.

Cancel multiple specific orders by their IDs. For canceling all orders, use /batch-cancel-all or /batch-cancel-all/{trading_pair_id}.

Sends a POST request to /api/v1/orders/batch-cancel

Source

pub async fn batch_cancel_all<'a>( &'a self, ) -> Result<ResponseValue<BatchCancelAllResponse>, Error<()>>

Cancel all orders

Cancel all orders.

Cancel all active orders for the authenticated user. To cancel orders for a specific trading pair, use /batch-cancel-all/{trading_pair_id}.

Sends a POST request to /api/v1/orders/batch-cancel-all

Source

pub async fn batch_cancel_all_by_pair<'a>( &'a self, trading_pair_id: &'a str, ) -> Result<ResponseValue<BatchCancelAllResponse>, Error<()>>

Cancel all orders for a trading pair

Cancel all orders for a trading pair.

Cancel all active orders for the authenticated user on a specific trading pair.

Sends a POST request to /api/v1/orders/batch-cancel-all/{trading_pair_id}

Source

pub async fn batch_create_orders<'a>( &'a self, body: &'a BatchCreateOrdersRequest, ) -> Result<ResponseValue<BatchCreateOrdersResponse>, Error<()>>

Batch create orders

Batch create orders.

Create multiple orders in a single batch. Each order is processed sequentially through the matching engine.

Sends a POST request to /api/v1/orders/batch-create

Source

pub async fn batch_replace_orders<'a>( &'a self, body: &'a BatchReplaceOrdersRequest, ) -> Result<ResponseValue<BatchReplaceOrdersResponse>, Error<()>>

Batch replace orders

Batch replace orders.

Replace multiple orders in a single batch. Each order is processed sequentially through the matching engine.

Sends a POST request to /api/v1/orders/batch-replace

Source

pub async fn cancel_order<'a>( &'a self, body: &'a CancelOrderRequest, ) -> Result<ResponseValue<CancelOrderResponse>, Error<()>>

Cancel existing order

Cancel existing order.

Cancel an existing order and unlock the reserved funds. Only orders that are not yet filled can be cancelled.

Sends a POST request to /api/v1/orders/cancel

Source

pub async fn get_order_by_id<'a>( &'a self, order_id: &'a str, ) -> Result<ResponseValue<GetOrderResponse>, Error<()>>

Get order by ID

Get order by ID.

Get a single order by its ID. Users can only access their own orders.

Sends a GET request to /api/v1/orders/{order_id}

Source

pub async fn replace_order<'a>( &'a self, order_id: &'a str, body: &'a ReplaceOrderRequest, ) -> Result<ResponseValue<ReplaceOrderResponse>, Error<()>>

Replace existing order

Replace existing order.

Replaces an existing order with new parameters by canceling the original order and creating a new one with the updated price/quantity. Priority is lost in the order book.

Sends a PUT request to /api/v1/orders/{order_id}

Source

pub async fn get_trade_by_id<'a>( &'a self, trade_id: &'a str, ) -> Result<ResponseValue<GetTradeByIdResponse>, Error<()>>

Get Trade by ID

Get Trade by ID

Retrieve a single trade by its unique identifier.

Sends a GET request to /api/v1/trades/by-id/{trade_id}

Source

pub async fn get_trades<'a>( &'a self, trading_pair_id: &'a str, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, ) -> Result<ResponseValue<GetTradesResponse>, Error<()>>

Recent Trades

Recent Trades

Get recent trades for a trading pair sorted by execution time.

Sends a GET request to /api/v1/trades/{trading_pair_id}

Arguments:

  • trading_pair_id
  • page: Page number (1-indexed)
  • page_size: Max trades to return (max 100)
Source

pub async fn submit_whitelist<'a>( &'a self, body: &'a SubmitWhitelistRequest, ) -> Result<ResponseValue<SubmitWhitelistResponse>, Error<()>>

Submit whitelist application

Submit whitelist application.

Submit a whitelist application to join Monaco Protocol. The user will be created with is_active = false and will need to be approved by an admin.

Sends a POST request to /api/v1/whitelist

Source

pub async fn health_check<'a>( &'a self, ) -> Result<ResponseValue<PublicHealthCheckResponse>, Error<()>>

Health check

Health check.

Returns the current health status of the API gateway and its connected services. Can be used for monitoring and load balancer health checks.

Sends a GET request to /health

Trait Implementations§

Source§

impl ClientHooks for &Client

Source§

async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Source§

async fn post<E>( &self, result: &Result<Response, Error>, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs after completion of the request.
Source§

async fn exec( &self, request: Request, info: &OperationInfo, ) -> Result<Response, Error>

Execute the request. Note that for almost any reasonable implementation this will include code equivalent to this: Read more
Source§

impl ClientInfo<()> for Client

Source§

fn api_version() -> &'static str

Get the version of this API. Read more
Source§

fn baseurl(&self) -> &str

Get the base URL to which requests are made.
Source§

fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.
Source§

fn inner(&self) -> &()

Get the inner value of type T if one is specified.
Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more