pub struct KalshiHttpClient { /* private fields */ }Expand description
REST transport for public discovery, account reports, and V2 order requests.
Public construction does not resolve credentials. Authenticated construction validates them before traffic. Safe reads retry transient failures twice at the adapter, acquiring quota before each fresh timestamp and signature. Redirects are never followed. Typed mutations use one adapter-owned attempt. Lower-level transport retries can replay the original signed request without entering adapter quota or signing. Callers reconcile uncertain or mismatched acknowledgements.
Implementations§
Source§impl KalshiHttpClient
impl KalshiHttpClient
Sourcepub fn new(config: &KalshiDataClientConfig) -> Result<Self>
pub fn new(config: &KalshiDataClientConfig) -> Result<Self>
Validates the data-client settings and creates the public transport.
Explicit proxies override direct routing. Ambient proxy variables are ignored.
§Errors
Returns an error if config validation or transport construction fails.
Sourcepub fn new_authenticated(config: &KalshiDataClientConfig) -> Result<Self>
pub fn new_authenticated(config: &KalshiDataClientConfig) -> Result<Self>
Creates an authenticated transport from explicit or selected-environment credentials.
§Errors
Returns an error if config, credentials, key encoding, or transport construction is invalid.
Sourcepub fn new_authenticated_with_quota(
config: &KalshiDataClientConfig,
quota: Arc<KalshiQuota>,
) -> Result<Self>
pub fn new_authenticated_with_quota( config: &KalshiDataClientConfig, quota: Arc<KalshiQuota>, ) -> Result<Self>
Creates an authenticated transport using the supplied account quota owner.
Share one owner across data and execution clients, including distinct keys for the same account. A key already bound to another owner is rejected before traffic.
§Errors
Returns an error if settings or credentials are invalid, or quota ownership conflicts.
Sourcepub fn new_with_quota(
config: &KalshiDataClientConfig,
quota: Arc<KalshiQuota>,
) -> Result<Self>
pub fn new_with_quota( config: &KalshiDataClientConfig, quota: Arc<KalshiQuota>, ) -> Result<Self>
Creates a public data transport sharing an authenticated account’s quota.
§Errors
Returns an error if settings or transport construction is invalid.
Sourcepub async fn refresh_quota(&self) -> Result<(), KalshiHttpError>
pub async fn refresh_quota(&self) -> Result<(), KalshiHttpError>
Refreshes authenticated limits and endpoint costs for the shared account owner.
Transports with credentials refresh lazily before ordinary traffic, including public reads. Fresh discovery or an active five-second fallback window returns without traffic. Failed discovery uses Basic read limits, one balance read per second, and a conservative 50-token read cost during the fallback window. Expiry uses those read budgets until refresh; writes wait for discovery and remain disabled if it fails. A subaccount-restricted key uses conservative Basic limits when the limits endpoint denies its scope; endpoint cost discovery remains required.
§Errors
Returns an error if endpoint costs are unavailable or invalid, or limit discovery fails without a recognized subaccount-restriction denial.
Sourcepub async fn get_exchange_status(&self) -> Result<HttpResponse, HttpClientError>
pub async fn get_exchange_status(&self) -> Result<HttpResponse, HttpClientError>
Fetches the public exchange status without authentication.
Non-success HTTP statuses remain responses for the caller to inspect.
§Errors
Returns an error if the request fails or exceeds the configured timeout.
Sourcepub async fn get_balance(
&self,
exchange_index: u32,
) -> Result<HttpResponse, KalshiHttpError>
pub async fn get_balance( &self, exchange_index: u32, ) -> Result<HttpResponse, KalshiHttpError>
Fetches the authenticated balance on an explicit exchange shard.
§Errors
Returns an error if authentication, quota admission, retries, or transport fails.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancels typed REST requests on this client and its clones.
Cancellation after dispatch does not establish whether a mutation reached the venue.
Sourcepub async fn get_status(&self) -> Result<ExchangeStatus, KalshiHttpError>
pub async fn get_status(&self) -> Result<ExchangeStatus, KalshiHttpError>
Fetches typed public exchange availability.
Documented maintenance responses (HTTP 500, 503, and 504) return their typed status body.
Use Self::get_exchange_status when the HTTP status and response headers are required.
§Errors
Returns an error if transport, cancellation, status, or response decoding fails.
Sourcepub async fn get_markets(
&self,
query: &MarketsQuery,
) -> Result<MarketsResponse, KalshiHttpError>
pub async fn get_markets( &self, query: &MarketsQuery, ) -> Result<MarketsResponse, KalshiHttpError>
Fetches one live market discovery page.
§Errors
Returns an error if encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_market(
&self,
ticker: &str,
) -> Result<MarketResponse, KalshiHttpError>
pub async fn get_market( &self, ticker: &str, ) -> Result<MarketResponse, KalshiHttpError>
Fetches one market by ticker.
§Errors
Returns an error if the ticker, transport, status, cancellation, or decoding is invalid.
Sourcepub async fn get_historical_markets(
&self,
query: &HistoricalMarketsQuery,
) -> Result<MarketsResponse, KalshiHttpError>
pub async fn get_historical_markets( &self, query: &HistoricalMarketsQuery, ) -> Result<MarketsResponse, KalshiHttpError>
Fetches one archived market discovery page.
§Errors
Returns an error if encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_historical_market(
&self,
ticker: &str,
) -> Result<MarketResponse, KalshiHttpError>
pub async fn get_historical_market( &self, ticker: &str, ) -> Result<MarketResponse, KalshiHttpError>
Fetches one archived market by ticker.
§Errors
Returns an error if the ticker, transport, status, cancellation, or decoding is invalid.
Sourcepub async fn get_events(
&self,
query: &EventsQuery,
) -> Result<EventsResponse, KalshiHttpError>
pub async fn get_events( &self, query: &EventsQuery, ) -> Result<EventsResponse, KalshiHttpError>
Fetches one event discovery page.
§Errors
Returns an error if encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_event(
&self,
ticker: &str,
query: &EventQuery,
) -> Result<EventResponse, KalshiHttpError>
pub async fn get_event( &self, ticker: &str, query: &EventQuery, ) -> Result<EventResponse, KalshiHttpError>
Fetches one event and its markets.
§Errors
Returns an error if the ticker, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_series_list(
&self,
query: &SeriesQuery,
) -> Result<SeriesListResponse, KalshiHttpError>
pub async fn get_series_list( &self, query: &SeriesQuery, ) -> Result<SeriesListResponse, KalshiHttpError>
Fetches series definitions.
§Errors
Returns an error if encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_series(
&self,
ticker: &str,
) -> Result<SeriesResponse, KalshiHttpError>
pub async fn get_series( &self, ticker: &str, ) -> Result<SeriesResponse, KalshiHttpError>
Fetches one series definition.
§Errors
Returns an error if the ticker, transport, cancellation, status, or decoding is invalid.
Sourcepub async fn get_orderbook(
&self,
ticker: &str,
depth: u32,
) -> Result<OrderbookResponse, KalshiHttpError>
pub async fn get_orderbook( &self, ticker: &str, depth: u32, ) -> Result<OrderbookResponse, KalshiHttpError>
Fetches exact YES and NO bid levels; zero depth requests all levels.
§Errors
Returns an error if depth exceeds 100, or transport, cancellation, status, or decoding fails.
Sourcepub async fn get_trades(
&self,
query: &TradesQuery,
) -> Result<TradesResponse, KalshiHttpError>
pub async fn get_trades( &self, query: &TradesQuery, ) -> Result<TradesResponse, KalshiHttpError>
Fetches one public trade page from the live tier.
§Errors
Returns an error if encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_historical_trades(
&self,
query: &TradesQuery,
) -> Result<TradesResponse, KalshiHttpError>
pub async fn get_historical_trades( &self, query: &TradesQuery, ) -> Result<TradesResponse, KalshiHttpError>
Fetches one public trade page from the archive.
§Errors
Returns an error if encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_candlesticks(
&self,
series: &str,
ticker: &str,
query: &CandlesticksQuery,
) -> Result<CandlesticksResponse, KalshiHttpError>
pub async fn get_candlesticks( &self, series: &str, ticker: &str, query: &CandlesticksQuery, ) -> Result<CandlesticksResponse, KalshiHttpError>
Fetches live market candles for a supported interval.
§Errors
Returns an error if the window, interval, transport, status, cancellation, or decoding fails.
Sourcepub async fn get_historical_candlesticks(
&self,
ticker: &str,
query: &CandlesticksQuery,
) -> Result<HistoricalCandlesticksResponse, KalshiHttpError>
pub async fn get_historical_candlesticks( &self, ticker: &str, query: &CandlesticksQuery, ) -> Result<HistoricalCandlesticksResponse, KalshiHttpError>
Fetches archived market candles.
§Errors
Returns an error if the window, interval, transport, status, cancellation, or decoding fails.
Sourcepub async fn get_historical_cutoff(
&self,
) -> Result<HistoricalCutoff, KalshiHttpError>
pub async fn get_historical_cutoff( &self, ) -> Result<HistoricalCutoff, KalshiHttpError>
Fetches each archive partition’s authoritative cutoff.
§Errors
Returns an error if transport, cancellation, status, or decoding fails.
Sourcepub async fn get_account_balance(
&self,
query: &AccountQuery,
) -> Result<Balance, KalshiHttpError>
pub async fn get_account_balance( &self, query: &AccountQuery, ) -> Result<Balance, KalshiHttpError>
Fetches typed collateral for an explicit subaccount and exchange shard.
§Errors
Returns an error if scope, authentication, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_positions(
&self,
query: &PositionsQuery,
) -> Result<PositionsResponse, KalshiHttpError>
pub async fn get_positions( &self, query: &PositionsQuery, ) -> Result<PositionsResponse, KalshiHttpError>
Fetches one live market/event position page.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_historical_positions(
&self,
query: &HistoricalPositionsQuery,
) -> Result<PositionsResponse, KalshiHttpError>
pub async fn get_historical_positions( &self, query: &HistoricalPositionsQuery, ) -> Result<PositionsResponse, KalshiHttpError>
Fetches one archived market/event position page.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_fills(
&self,
query: &FillsQuery,
) -> Result<FillsResponse, KalshiHttpError>
pub async fn get_fills( &self, query: &FillsQuery, ) -> Result<FillsResponse, KalshiHttpError>
Fetches one live fills page.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_historical_fills(
&self,
query: &HistoryQuery,
) -> Result<FillsResponse, KalshiHttpError>
pub async fn get_historical_fills( &self, query: &HistoryQuery, ) -> Result<FillsResponse, KalshiHttpError>
Fetches one archived fills page.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_orders(
&self,
query: &OrdersQuery,
) -> Result<OrdersResponse, KalshiHttpError>
pub async fn get_orders( &self, query: &OrdersQuery, ) -> Result<OrdersResponse, KalshiHttpError>
Fetches one live orders page.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_order(
&self,
order_id: &str,
) -> Result<OrderResponse, KalshiHttpError>
pub async fn get_order( &self, order_id: &str, ) -> Result<OrderResponse, KalshiHttpError>
Fetches one order by its venue identity.
§Errors
Returns an error if identity, authentication, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_historical_orders(
&self,
query: &HistoryQuery,
) -> Result<OrdersResponse, KalshiHttpError>
pub async fn get_historical_orders( &self, query: &HistoryQuery, ) -> Result<OrdersResponse, KalshiHttpError>
Fetches one archived orders page.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_settlements(
&self,
query: &SettlementsQuery,
) -> Result<SettlementsResponse, KalshiHttpError>
pub async fn get_settlements( &self, query: &SettlementsQuery, ) -> Result<SettlementsResponse, KalshiHttpError>
Fetches one page of settlements still held in the live tier.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_account_limits(&self) -> Result<AccountLimits, KalshiHttpError>
pub async fn get_account_limits(&self) -> Result<AccountLimits, KalshiHttpError>
Fetches token limits and updates the shared account quota owner.
§Errors
Returns an error if authentication, transport, cancellation, status, decoding, or quota validation fails.
Sourcepub async fn get_endpoint_costs(&self) -> Result<EndpointCosts, KalshiHttpError>
pub async fn get_endpoint_costs(&self) -> Result<EndpointCosts, KalshiHttpError>
Fetches endpoint token costs and updates the shared account quota owner.
§Errors
Returns an error if transport, cancellation, status, decoding, or quota validation fails.
Sourcepub async fn create_order(
&self,
request: &CreateOrderRequest,
) -> Result<CreateOrderResponse, KalshiHttpError>
pub async fn create_order( &self, request: &CreateOrderRequest, ) -> Result<CreateOrderResponse, KalshiHttpError>
Sends one V2 limit-order request without replay.
§Errors
Returns an error if validation, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn batch_create_orders(
&self,
request: &BatchCreateRequest,
) -> Result<BatchCreateResponse, KalshiHttpError>
pub async fn batch_create_orders( &self, request: &BatchCreateRequest, ) -> Result<BatchCreateResponse, KalshiHttpError>
Sends independent V2 order requests once in one batch.
Each child requires a unique, non-empty client order identity. Reply identities must match.
§Errors
Returns an error if validation, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn amend_order(
&self,
order_id: &str,
subaccount: u32,
request: &AmendOrderRequest,
) -> Result<AmendOrderResponse, KalshiHttpError>
pub async fn amend_order( &self, order_id: &str, subaccount: u32, request: &AmendOrderRequest, ) -> Result<AmendOrderResponse, KalshiHttpError>
Sends a V2 amendment once. Expiration remains a raw protocol field.
Callers verify returned order and client identities, then obtain authoritative order reports.
§Errors
Returns an error if scope, values, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn decrease_order(
&self,
order_id: &str,
subaccount: u32,
request: &DecreaseOrderRequest,
) -> Result<DecreaseOrderResponse, KalshiHttpError>
pub async fn decrease_order( &self, order_id: &str, subaccount: u32, request: &DecreaseOrderRequest, ) -> Result<DecreaseOrderResponse, KalshiHttpError>
Sends a V2 decrease once, using exactly one selector.
Callers verify returned order and client identities, then obtain authoritative order reports.
§Errors
Returns an error if scope, selectors, values, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn cancel_order(
&self,
order_id: &str,
query: &AccountQuery,
) -> Result<CancelOrderResponse, KalshiHttpError>
pub async fn cancel_order( &self, order_id: &str, query: &AccountQuery, ) -> Result<CancelOrderResponse, KalshiHttpError>
Cancels one selected V2 order once on an explicit shard.
Callers verify returned order and client identities, then obtain authoritative order reports.
§Errors
Returns an error if scope, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn batch_cancel_orders(
&self,
request: &BatchCancelRequest,
) -> Result<BatchCancelResponse, KalshiHttpError>
pub async fn batch_cancel_orders( &self, request: &BatchCancelRequest, ) -> Result<BatchCancelResponse, KalshiHttpError>
Cancels only the explicitly selected V2 orders, without replay.
Selected order identities must be unique. Reply identities must match the selected set.
§Errors
Returns an error if scope, identities, authentication, encoding, transport, cancellation, status, or decoding fails.
Sourcepub async fn get_all_markets(
&self,
query: MarketsQuery,
max_pages: u32,
) -> Result<Pages<Market>, KalshiHttpError>
pub async fn get_all_markets( &self, query: MarketsQuery, max_pages: u32, ) -> Result<Pages<Market>, KalshiHttpError>
Collects live market pages with stable-ticker deduplication and a page budget.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_historical_markets(
&self,
query: HistoricalMarketsQuery,
max_pages: u32,
) -> Result<Pages<Market>, KalshiHttpError>
pub async fn get_all_historical_markets( &self, query: HistoricalMarketsQuery, max_pages: u32, ) -> Result<Pages<Market>, KalshiHttpError>
Collects archived market pages with stable-ticker deduplication.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_events(
&self,
query: EventsQuery,
max_pages: u32,
) -> Result<Pages<Event>, KalshiHttpError>
pub async fn get_all_events( &self, query: EventsQuery, max_pages: u32, ) -> Result<Pages<Event>, KalshiHttpError>
Collects event pages with stable-event-identity deduplication.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_trades(
&self,
query: TradesQuery,
max_pages: u32,
) -> Result<Pages<Trade>, KalshiHttpError>
pub async fn get_all_trades( &self, query: TradesQuery, max_pages: u32, ) -> Result<Pages<Trade>, KalshiHttpError>
Collects live trades, deduplicating inclusive boundaries by trade identity.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_historical_trades(
&self,
query: TradesQuery,
max_pages: u32,
) -> Result<Pages<Trade>, KalshiHttpError>
pub async fn get_all_historical_trades( &self, query: TradesQuery, max_pages: u32, ) -> Result<Pages<Trade>, KalshiHttpError>
Collects archived trades with stable-trade-identity deduplication.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_fills(
&self,
query: FillsQuery,
max_pages: u32,
) -> Result<Pages<Fill>, KalshiHttpError>
pub async fn get_all_fills( &self, query: FillsQuery, max_pages: u32, ) -> Result<Pages<Fill>, KalshiHttpError>
Collects live fills, deduplicating by shard and fill identity.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_historical_fills(
&self,
query: HistoryQuery,
max_pages: u32,
) -> Result<Pages<Fill>, KalshiHttpError>
pub async fn get_all_historical_fills( &self, query: HistoryQuery, max_pages: u32, ) -> Result<Pages<Fill>, KalshiHttpError>
Collects archived fills, deduplicating by shard and fill identity.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_orders(
&self,
query: OrdersQuery,
max_pages: u32,
) -> Result<Pages<Order>, KalshiHttpError>
pub async fn get_all_orders( &self, query: OrdersQuery, max_pages: u32, ) -> Result<Pages<Order>, KalshiHttpError>
Collects live order reports with stable-order-identity deduplication.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_historical_orders(
&self,
query: HistoryQuery,
max_pages: u32,
) -> Result<Pages<Order>, KalshiHttpError>
pub async fn get_all_historical_orders( &self, query: HistoryQuery, max_pages: u32, ) -> Result<Pages<Order>, KalshiHttpError>
Collects archived order reports with stable-order-identity deduplication.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_settlements(
&self,
query: SettlementsQuery,
max_pages: u32,
) -> Result<Pages<Settlement>, KalshiHttpError>
pub async fn get_all_settlements( &self, query: SettlementsQuery, max_pages: u32, ) -> Result<Pages<Settlement>, KalshiHttpError>
Collects live settlement records with shard/ticker deduplication.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_positions(
&self,
query: PositionsQuery,
max_pages: u32,
) -> Result<PositionPages, KalshiHttpError>
pub async fn get_all_positions( &self, query: PositionsQuery, max_pages: u32, ) -> Result<PositionPages, KalshiHttpError>
Collects live market and event positions without discarding either list.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Sourcepub async fn get_all_historical_positions(
&self,
query: HistoricalPositionsQuery,
max_pages: u32,
) -> Result<PositionPages, KalshiHttpError>
pub async fn get_all_historical_positions( &self, query: HistoricalPositionsQuery, max_pages: u32, ) -> Result<PositionPages, KalshiHttpError>
Collects archived market and event positions; shard identity stays record-level.
§Errors
Returns an error if any source fails, the budget is zero, or pagination makes no progress.
Source§impl KalshiHttpClient
impl KalshiHttpClient
Sourcepub async fn get_trades_range(
&self,
query: TradesQuery,
max_pages: u32,
) -> Result<Vec<Trade>, KalshiHttpError>
pub async fn get_trades_range( &self, query: TradesQuery, max_pages: u32, ) -> Result<Vec<Trade>, KalshiHttpError>
Collects a bounded trade window, oldest first with trade ID breaking timestamp ties.
The cutoff is read once. A window reaching it reads live pages before a full-window
archive probe to cover a forward handoff between the reads. The venue does not promise an
atomic snapshot across pages. limit is a page size, not a result limit.
§Errors
Returns an error if:
- The query is invalid, unbounded, or resumed.
- Pagination is incomplete, duplicates conflict, or records do not match.
- Any source fails.
Sourcepub async fn get_candlesticks_range(
&self,
market: &Market,
series: &str,
query: &CandlesticksQuery,
) -> Result<Vec<Candlestick>, KalshiHttpError>
pub async fn get_candlesticks_range( &self, market: &Market, series: &str, query: &CandlesticksQuery, ) -> Result<Vec<Candlestick>, KalshiHttpError>
Fetches native candles using market settlement time to select the archive partition.
The cutoff is read once. A settled market still in the live tier receives an archive probe after the live read to cover a forward handoff. Endpoint time bounds apply to candle end timestamps.
§Errors
Returns an error if:
- Bounds or periods are invalid, or a finalized market has no settlement evidence.
- Market identity does not match, candles conflict, or a source fails.
Trait Implementations§
Source§impl Clone for KalshiHttpClient
impl Clone for KalshiHttpClient
Auto Trait Implementations§
impl !Freeze for KalshiHttpClient
impl !RefUnwindSafe for KalshiHttpClient
impl !UnwindSafe for KalshiHttpClient
impl Send for KalshiHttpClient
impl Sync for KalshiHttpClient
impl Unpin for KalshiHttpClient
impl UnsafeUnpin for KalshiHttpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more