Skip to main content

Client

Struct Client 

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

Typed HTTP client for the Nordnet API. Cheap to clone — wraps a reqwest::Client and a base URL + optional session.

Implementations§

Source§

impl Client

Source

pub fn new(base_url: impl Into<String>) -> Result<Self, Error>

Build a client for the given base URL (e.g. https://public.nordnet.se/api/2). The base URL is used verbatim; trailing slashes are stripped.

Source

pub fn with_session(self, session: Session) -> Self

Attach (or replace) the authenticated session used for the Authorization header on subsequent requests.

Source

pub fn session(&self) -> Option<&Session>

Active session, if any. Mostly useful for tests.

Source

pub fn base_url(&self) -> &str

Base URL the client targets.

Source

pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T, Error>

GET <base_url><path> and parse the JSON body as T.

Source

pub async fn post<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T, Error>

POST a JSON body to <base_url><path> and parse the JSON response.

Source

pub async fn put<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T, Error>

PUT a JSON body to <base_url><path> and parse the JSON response.

Source

pub async fn post_form<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T, Error>

POST a body to <base_url><path> encoded as application/x-www-form-urlencoded, and parse the JSON response.

Required for endpoints whose Swagger 2.0 parameter table marks every body parameter as FormData (e.g. POST /accounts/{accid}/orders). JSON bodies are silently rejected by these endpoints.

Source

pub async fn put_form<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T, Error>

PUT a body to <base_url><path> encoded as application/x-www-form-urlencoded, and parse the JSON response.

Required for endpoints whose Swagger 2.0 parameter table marks every body parameter as FormData (e.g. PUT /accounts/{accid}/orders/{order_id}).

Source

pub async fn put_empty<T: DeserializeOwned>( &self, path: &str, ) -> Result<T, Error>

PUT <base_url><path> with no request body. The wire request omits the Content-Type header and sends a zero-length body — this is the shape Nordnet’s PUT /login (refresh session) expects.

Source

pub async fn delete<T: DeserializeOwned>(&self, path: &str) -> Result<T, Error>

DELETE <base_url><path> and parse the JSON response.

Source

pub fn url(&self, path: &str) -> String

Compose the full URL for path. Public so tests and resource modules can build requests without re-implementing the rule.

Source§

impl Client

Source

pub async fn list_accounts( &self, query: ListAccountsQuery, ) -> Result<Vec<Account>, Error>

GET /accounts — Returns a list of accounts to which the user has access.

Returns an empty Vec on 204 No Content.

§Errors

Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn get_account_info( &self, accid: AccountId, query: AccountInfoQuery, ) -> Result<Vec<AccountInfo>, Error>

GET /accounts/{accid}/info — Returns account information details for one or more accounts.

accid is one or more account identifier(s). The single-account accid: AccountId parameter is the strongly-typed shape; multi- account lookups (the API accepts a comma-separated list in the path) are deferred to a higher-level helper.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_ledgers( &self, accid: AccountId, ) -> Result<LedgerInformation, Error>

GET /accounts/{accid}/ledgers — Returns information about the currency ledgers of an account.

Note: 204 is documented but cannot be mapped to an empty default because LedgerInformation is a single object (not an array). In that case the underlying Error::Decode is returned.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_positions( &self, accid: AccountId, query: ListPositionsQuery, ) -> Result<Vec<Position>, Error>

GET /accounts/{accid}/positions — Returns all positions for the given account.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn get_returns_today( &self, accid: AccountId, query: ReturnsTodayQuery, ) -> Result<Vec<AccountTransactionsToday>, Error>

GET /accounts/{accid}/returns/transactions/today — Returns today’s withdrawal/deposit transaction amounts for the given account.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_account_trades( &self, accid: AccountId, query: ListAccountTradesQuery, ) -> Result<Vec<Trade>, Error>

GET /accounts/{accid}/trades — Returns all trades belonging to the given account.

Renamed from the docs op list_trades to list_account_trades to coexist with Client::list_tradable_trades and Client::list_instrument_trades on the same Client impl.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), 404 (documented as “Account not found”; surfaced via Error::UnexpectedStatus because the foundation Error enum does not model 404 as a dedicated variant), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source§

impl Client

Source

pub async fn list_countries(&self) -> Result<Vec<Country>, Error>

Return all countries known to the Nordnet system.

Not every returned country supports trading.

Calls GET /countries.

Source

pub async fn get_country(&self, code: &str) -> Result<Vec<Country>, Error>

Look up one or more countries by ISO country code.

Multiple codes can be queried in a single call by passing a comma-separated string (e.g. "SE,NO"). Returns an empty Vec when the API responds with 204 No Content (no matching countries).

Calls GET /countries/{country}.

Source§

impl Client

Source

pub async fn get_attributes( &self, filters: AttributesQuery<'_>, ) -> Result<AttributeResults, Error>

GET /instrument_search/attributes — Search for attributes available in the instrument search APIs.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn search_stocklist( &self, filters: StocklistQuery<'_>, ) -> Result<StocklistResults, Error>

GET /instrument_search/query/stocklist — Search for stocks.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn search_bullbearlist( &self, filters: ListSearchQuery<'_>, ) -> Result<BullBearListResults, Error>

GET /instrument_search/query/bullbearlist — Search, filter and sort instruments within the Bull & Bear entity type.

204 No Content is documented for this op; it is mapped to an empty BullBearListResults (every field defaulted to None).

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn search_minifuturelist( &self, filters: ListSearchQuery<'_>, ) -> Result<MinifutureListResults, Error>

GET /instrument_search/query/minifuturelist — Search, filter and sort instruments within the Mini Future entity type.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn search_unlimitedturbolist( &self, filters: ListSearchQuery<'_>, ) -> Result<UnlimitedTurboListResults, Error>

GET /instrument_search/query/unlimitedturbolist — Search, filter and sort instruments within the Unlimited Turbo entity type.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn search_optionlist_pairs( &self, currency: &str, expire_date: i64, underlying_symbol: &str, ) -> Result<OptionListResults, Error>

GET /instrument_search/query/optionlist/pairs — Search for the Option Pair (Put-Call) given an underlying instrument and the expiration date.

All three parameters are required per the doc:

  • currency: option currency (e.g. "SEK").
  • expire_date: expiration date as a Nordnet UNIX-millis epoch timestamp (integer(int64) per the doc).
  • underlying_symbol: underlying instrument symbol (e.g. "ERIC B").
§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source§

impl Client

Source

pub async fn lookup( &self, lookup_type: &str, lookup: &str, ) -> Result<Vec<Instrument>, Error>

GET /instruments/lookup/{lookup_type}/{lookup} — Lookup specific instruments with predefined fields.

lookup_type must be one of the documented enum values: market_id_identifier or isin_code_currency_market_id. lookup is formatted as [market_id]:[identifier] or [isin]:[currency]:[market_id] respectively. Multiple entries are comma-separated. Pass-through &str for now.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_types(&self) -> Result<Vec<InstrumentType>, Error>

GET /instruments/types — Returns all Nordnet instrument types.

§Errors

Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn get_type( &self, instrument_type: &str, ) -> Result<Vec<InstrumentType>, Error>

GET /instruments/types/{instrument_type} — Returns information about one or more Nordnet instrument types.

instrument_type is one or more comma-separated type codes (pass-through &str).

Returns an empty Vec on 204 No Content.

§Errors

Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_underlyings( &self, derivative_type: &str, currency: &str, ) -> Result<Vec<Instrument>, Error>

GET /instruments/underlyings/{derivative_type}/{currency} — Returns instruments that are underlyings for a specific type of instruments.

derivative_type is one of leverage or option_pair. currency is the derivative currency (note the underlying may have a different currency). Both pass-through &str.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn get_instrument_suitability( &self, instrument_id: InstrumentId, ) -> Result<Vec<InstrumentEligibility>, Error>

GET /instruments/validation/suitability/{instrument_id} — Returns the customer’s trading eligibility for the given instrument(s).

Renamed from the docs op get_suitability to get_instrument_suitability to coexist with tradables::get_suitability on the same Client impl.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403; documented for anonymous sessions and returned with an empty body), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn get_instrument( &self, instrument_id: InstrumentId, ) -> Result<Vec<Instrument>, Error>

GET /instruments/{instrument_id} — Returns instrument information for the given instrument ID(s).

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_leverages( &self, instrument_id: InstrumentId, filters: LeveragesQuery<'_>, ) -> Result<Vec<Instrument>, Error>

GET /instruments/{instrument_id}/leverages — Returns a list of leverage instruments that have the current instrument as underlying.

Filters are passed as a LeveragesQuery; pass &LeveragesQuery::default() for “no filters”.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn get_leverage_filters( &self, instrument_id: InstrumentId, ) -> Result<LeverageFilter, Error>

GET /instruments/{instrument_id}/leverages/filters — Returns valid leverage instruments filter values for the given underlying.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source

pub async fn list_instrument_trades( &self, instrument_id: InstrumentId, ) -> Result<Vec<InstrumentPublicTrades>, Error>

GET /instruments/{instrument_id}/trades — Returns the public trades belonging to one or more instruments.

Renamed from the docs op list_trades to list_instrument_trades to coexist with tradables::list_tradable_trades and the future accounts::list_trades on the same Client impl.

Returns an empty Vec on 204 No Content.

§Errors

Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), Error::ServiceUnavailable (503).

Source§

impl Client

Source

pub async fn start_login( &self, request: &ApiKeyStartLoginRequest, ) -> Result<ChallengeResponse, Error>

POST /login/start — Start the authentication challenge.

Returns a ChallengeResponse whose challenge field must be signed with the caller’s RSA private key (see nordnet_model::auth::sign_challenge) before being passed to Client::verify_login. The challenge is valid for 30 seconds.

§Errors

Returns Error::BadRequest (400), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn verify_login( &self, request: &ApiKeyVerifyLoginRequest, ) -> Result<ApiKeyLoginResponse, Error>

POST /login/verify — Complete the login flow with a signed challenge.

On success the returned ApiKeyLoginResponse carries the session_key. Convert it to a nordnet_model::auth::Session via ApiKeyLoginResponse::to_session and attach it with Client::with_session for subsequent authenticated calls.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn refresh_session(&self) -> Result<LoggedInStatus, Error>

PUT /login — Touch the session to keep it alive.

Any other authenticated call also touches the session, so this is only needed when the application is otherwise idle for the full session timeout interval.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn logout(&self) -> Result<LoggedInStatus, Error>

DELETE /login — Invalidate the current session.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source§

impl Client

Source

pub async fn search( &self, query: &str, instrument_group: Option<&[&str]>, limit: Option<i32>, offset: Option<i32>, search_space: Option<&str>, ) -> Result<Vec<MainSearchResponse>, Error>

GET /main_search — Returns the instruments, news, and pages matching the given search criteria.

§Parameters
  • query — required search string.
  • instrument_group — optional list of instrument groups to restrict the search to (EQUITY, PINV, FUND, ETF, ETC, WARRANT, DERIVATIVES, INDICATOR, OTHER). When None, results from every group are returned. Encoded as repeated instrument_group=... pairs.
  • limit — optional per-group result limit (default 5).
  • offset — optional per-group result offset (default 0).
  • search_space — optional search space (ALL, INSTRUMENTS, NEWS, CMS, BLOG, INSTRUMENTS_NEWS, INSTRUMENTS_CMS, NEWS_CMS, NEWS_BLOG, NEWS_BLOG_CMS). Default ALL.
§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

HTTP 204 (No Content) and 404 (No Content) responses are mapped to an empty Vec<MainSearchResponse> (per the get_country precedent).

Source§

impl Client

Source

pub async fn list_markets(&self) -> Result<Vec<Market>, Error>

GET /markets — Returns information about all tradable markets.

§Errors

Returns Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source

pub async fn get_market(&self, id: MarketId) -> Result<Vec<Market>, Error>

GET /markets/{market_id} — Returns information about the market identified by id.

Returns an empty Vec when the API responds with 204 No Content (no matching markets).

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source§

impl Client

Source

pub async fn get_news_item(&self, id: NewsId) -> Result<Vec<NewsArticle>, Error>

GET /news/{item_id} — Retrieve a news article by ID.

Returns an empty Vec when the API responds with 204 No Content (no matching article).

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source

pub async fn list_news_sources(&self) -> Result<Vec<NewsSource>, Error>

GET /news_sources — Returns the news sources the user has access to.

§Errors

Returns Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source§

impl Client

Source

pub async fn list_orders( &self, accid: AccountId, deleted: Option<bool>, ) -> Result<Vec<Order>, Error>

GET /accounts/{accid}/orders — Returns all orders belonging to the given account.

§Parameters
  • accid — the account identifier.
  • deleted — optional. When Some(true), the response includes orders that were deleted today. Defaults to false server-side.

Returns an empty Vec when the API responds with 204 No Content.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403; documented with empty body), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn place_order( &self, accid: AccountId, request: &PlaceOrderRequest, ) -> Result<OrderReply, Error>

POST /accounts/{accid}/orders — Enters a new order for the tradable identified by the given market ID + tradable ID.

The Nordnet docs mark every body parameter as Swagger 2.0 FormData, so the request is sent as application/x-www-form-urlencoded via Client::post_form. JSON bodies are silently rejected by the live endpoint. See `` §“Locked decisions” item 9.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn modify_order( &self, accid: AccountId, order_id: OrderId, request: &ModifyOrderRequest, ) -> Result<OrderReply, Error>

PUT /accounts/{accid}/orders/{order_id} — Modifies the price and/or volume of an order.

The Nordnet docs mark every body parameter as Swagger 2.0 FormData, so the request is sent as application/x-www-form-urlencoded via Client::put_form. See `` §“Locked decisions” item 9.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::UnexpectedStatus (404; documented “Order not found”), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn activate_order( &self, accid: AccountId, order_id: OrderId, ) -> Result<Vec<OrderReply>, Error>

PUT /accounts/{accid}/orders/{order_id}/activate — Activates an inactive order. Sends a body-less PUT per the docs.

The doc parameter table notes that order_id accepts a comma-separated list and the response is therefore an array of OrderReply. The single-id call still receives an array (of length one).

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source

pub async fn cancel_order( &self, accid: AccountId, order_id: OrderId, ) -> Result<OrderReply, Error>

DELETE /accounts/{accid}/orders/{order_id} — Deletes an order.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) per the docs.

Source§

impl Client

Source

pub async fn get_system_status(&self) -> Result<Status, Error>

GET /api/2 — Returns information about the system status.

The path is the API root itself (relative to the configured base URL). In production the base URL is https://public.nordnet.se/api/2, so this method issues GET https://public.nordnet.se/api/2/.

Source§

impl Client

Source

pub async fn list_tick_sizes(&self) -> Result<Vec<TicksizeTable>, Error>

GET /tick_sizes — Returns a list of all tick size tables.

§Errors

Returns Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source

pub async fn get_tick_size( &self, id: TickSizeId, ) -> Result<Vec<TicksizeTable>, Error>

GET /tick_sizes/{tick_size_id} — Returns one or more tick size tables identified by id.

The Nordnet API path parameter technically accepts a comma-separated list of IDs. This method covers the single-ID case. A future helper may be added for multi-ID lookups when needed (Phase 4+).

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source§

impl Client

Source

pub async fn get_tradable_info( &self, key: &TradableKey, ) -> Result<Vec<TradableInfo>, Error>

GET /tradables/info/{tradables} — Returns trading calendar and allowed trading types for the given tradable.

Returns an empty Vec when the API responds with 204 No Content (no matching tradables).

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Source

pub async fn list_tradable_trades( &self, key: &TradableKey, count: Option<&str>, ) -> Result<Vec<TradablePublicTrades>, Error>

GET /tradables/trades/{tradables} — Returns the public trades (all trades executed on the marketplace) for the given tradable.

§Parameters
  • key — the tradable to look up.
  • count — optional. Number of trades to return. The API accepts either a positive integer ("5", "10", …) or the literal string "all"; the default is "5". Passed through verbatim.

Returns an empty Vec when the API responds with 204 No Content.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

§Naming

The Nordnet docs call this op list_trades; renamed here to list_tradable_trades so it can co-exist with the same-named ops planned for the accounts and instruments groups (see module doc).

Source

pub async fn get_suitability( &self, key: &TradableKey, ) -> Result<Vec<TradableEligibility>, Error>

GET /tradables/validation/suitability/{tradables} — Returns the customer’s trading eligibility for the given tradable.

Returns an empty Vec when the API responds with 204 No Content.

§Errors

Returns Error::BadRequest (400), Error::Unauthorized (401), Error::Forbidden (403; documented for anonymous sessions and returned with an empty body), Error::TooManyRequests (429), or Error::ServiceUnavailable (503) as documented.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · 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> Same for T

Source§

type Output = T

Should always be Self
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