pub struct BybitHttpClient { /* private fields */ }Expand description
Provides a HTTP client for connecting to the Bybit REST API. High-level HTTP client that wraps the raw client and provides Nautilus domain types.
This client maintains an instrument cache and uses it to parse venue responses into Nautilus domain objects.
Implementations§
Source§impl BybitHttpClient
impl BybitHttpClient
Sourcepub fn new(
base_url: Option<String>,
timeout_secs: Option<u64>,
max_retries: Option<u32>,
retry_delay_ms: Option<u64>,
retry_delay_max_ms: Option<u64>,
recv_window_ms: Option<u64>,
proxy_url: Option<String>,
) -> Result<Self, BybitHttpError>
pub fn new( base_url: Option<String>, timeout_secs: Option<u64>, max_retries: Option<u32>, retry_delay_ms: Option<u64>, retry_delay_max_ms: Option<u64>, recv_window_ms: Option<u64>, proxy_url: Option<String>, ) -> Result<Self, BybitHttpError>
Creates a new BybitHttpClient using the default Bybit HTTP URL.
§Errors
Returns an error if the retry manager cannot be created.
Sourcepub fn with_credentials(
api_key: String,
api_secret: String,
base_url: Option<String>,
timeout_secs: Option<u64>,
max_retries: Option<u32>,
retry_delay_ms: Option<u64>,
retry_delay_max_ms: Option<u64>,
recv_window_ms: Option<u64>,
proxy_url: Option<String>,
) -> Result<Self, BybitHttpError>
pub fn with_credentials( api_key: String, api_secret: String, base_url: Option<String>, timeout_secs: Option<u64>, max_retries: Option<u32>, retry_delay_ms: Option<u64>, retry_delay_max_ms: Option<u64>, recv_window_ms: Option<u64>, proxy_url: Option<String>, ) -> Result<Self, BybitHttpError>
Creates a new BybitHttpClient configured with credentials.
§Errors
Returns an error if the retry manager cannot be created.
pub fn base_url(&self) -> &str
pub fn recv_window_ms(&self) -> u64
pub fn credential(&self) -> Option<&Credential>
pub fn set_use_spot_position_reports(&self, use_spot_position_reports: bool)
pub fn cancel_all_requests(&self)
pub fn cancellation_token(&self) -> &CancellationToken
Sourcepub fn cache_instrument(&self, instrument: InstrumentAny)
pub fn cache_instrument(&self, instrument: InstrumentAny)
Any existing instrument with the same symbol will be replaced.
Sourcepub fn cache_instruments(&self, instruments: Vec<InstrumentAny>)
pub fn cache_instruments(&self, instruments: Vec<InstrumentAny>)
Any existing instruments with the same symbols will be replaced.
pub fn get_instrument(&self, symbol: &Ustr) -> Option<InstrumentAny>
Sourcepub async fn get_server_time(
&self,
) -> Result<BybitServerTimeResponse, BybitHttpError>
pub async fn get_server_time( &self, ) -> Result<BybitServerTimeResponse, BybitHttpError>
Sourcepub async fn get_instruments<T: DeserializeOwned>(
&self,
params: &BybitInstrumentsInfoParams,
) -> Result<T, BybitHttpError>
pub async fn get_instruments<T: DeserializeOwned>( &self, params: &BybitInstrumentsInfoParams, ) -> Result<T, BybitHttpError>
Sourcepub async fn get_instruments_spot(
&self,
params: &BybitInstrumentsInfoParams,
) -> Result<BybitInstrumentSpotResponse, BybitHttpError>
pub async fn get_instruments_spot( &self, params: &BybitInstrumentsInfoParams, ) -> Result<BybitInstrumentSpotResponse, BybitHttpError>
Sourcepub async fn get_instruments_linear(
&self,
params: &BybitInstrumentsInfoParams,
) -> Result<BybitInstrumentLinearResponse, BybitHttpError>
pub async fn get_instruments_linear( &self, params: &BybitInstrumentsInfoParams, ) -> Result<BybitInstrumentLinearResponse, BybitHttpError>
Sourcepub async fn get_instruments_inverse(
&self,
params: &BybitInstrumentsInfoParams,
) -> Result<BybitInstrumentInverseResponse, BybitHttpError>
pub async fn get_instruments_inverse( &self, params: &BybitInstrumentsInfoParams, ) -> Result<BybitInstrumentInverseResponse, BybitHttpError>
Sourcepub async fn get_instruments_option(
&self,
params: &BybitInstrumentsInfoParams,
) -> Result<BybitInstrumentOptionResponse, BybitHttpError>
pub async fn get_instruments_option( &self, params: &BybitInstrumentsInfoParams, ) -> Result<BybitInstrumentOptionResponse, BybitHttpError>
Sourcepub async fn get_klines(
&self,
params: &BybitKlinesParams,
) -> Result<BybitKlinesResponse, BybitHttpError>
pub async fn get_klines( &self, params: &BybitKlinesParams, ) -> Result<BybitKlinesResponse, BybitHttpError>
Sourcepub async fn get_recent_trades(
&self,
params: &BybitTradesParams,
) -> Result<BybitTradesResponse, BybitHttpError>
pub async fn get_recent_trades( &self, params: &BybitTradesParams, ) -> Result<BybitTradesResponse, BybitHttpError>
Sourcepub async fn get_open_orders(
&self,
category: BybitProductType,
symbol: Option<&str>,
) -> Result<BybitOpenOrdersResponse, BybitHttpError>
pub async fn get_open_orders( &self, category: BybitProductType, symbol: Option<&str>, ) -> Result<BybitOpenOrdersResponse, BybitHttpError>
Sourcepub async fn place_order(
&self,
request: &Value,
) -> Result<BybitPlaceOrderResponse, BybitHttpError>
pub async fn place_order( &self, request: &Value, ) -> Result<BybitPlaceOrderResponse, BybitHttpError>
Sourcepub async fn get_wallet_balance(
&self,
params: &BybitWalletBalanceParams,
) -> Result<BybitWalletBalanceResponse, BybitHttpError>
pub async fn get_wallet_balance( &self, params: &BybitWalletBalanceParams, ) -> Result<BybitWalletBalanceResponse, BybitHttpError>
Sourcepub async fn get_account_details(
&self,
) -> Result<BybitAccountDetailsResponse, BybitHttpError>
pub async fn get_account_details( &self, ) -> Result<BybitAccountDetailsResponse, BybitHttpError>
Sourcepub async fn get_positions(
&self,
params: &BybitPositionListParams,
) -> Result<BybitPositionListResponse, BybitHttpError>
pub async fn get_positions( &self, params: &BybitPositionListParams, ) -> Result<BybitPositionListResponse, BybitHttpError>
Sourcepub async fn get_fee_rate(
&self,
params: &BybitFeeRateParams,
) -> Result<BybitFeeRateResponse, BybitHttpError>
pub async fn get_fee_rate( &self, params: &BybitFeeRateParams, ) -> Result<BybitFeeRateResponse, BybitHttpError>
Sourcepub async fn set_margin_mode(
&self,
margin_mode: BybitMarginMode,
) -> Result<BybitSetMarginModeResponse, BybitHttpError>
pub async fn set_margin_mode( &self, margin_mode: BybitMarginMode, ) -> Result<BybitSetMarginModeResponse, BybitHttpError>
Sourcepub async fn set_leverage(
&self,
product_type: BybitProductType,
symbol: &str,
buy_leverage: &str,
sell_leverage: &str,
) -> Result<BybitSetLeverageResponse, BybitHttpError>
pub async fn set_leverage( &self, product_type: BybitProductType, symbol: &str, buy_leverage: &str, sell_leverage: &str, ) -> Result<BybitSetLeverageResponse, BybitHttpError>
Sourcepub async fn switch_mode(
&self,
product_type: BybitProductType,
mode: BybitPositionMode,
symbol: Option<String>,
coin: Option<String>,
) -> Result<BybitSwitchModeResponse, BybitHttpError>
pub async fn switch_mode( &self, product_type: BybitProductType, mode: BybitPositionMode, symbol: Option<String>, coin: Option<String>, ) -> Result<BybitSwitchModeResponse, BybitHttpError>
Sourcepub async fn set_trading_stop(
&self,
params: &BybitSetTradingStopParams,
) -> Result<BybitSetTradingStopResponse, BybitHttpError>
pub async fn set_trading_stop( &self, params: &BybitSetTradingStopParams, ) -> Result<BybitSetTradingStopResponse, BybitHttpError>
Sourcepub async fn get_spot_borrow_amount(&self, coin: &str) -> Result<Decimal>
pub async fn get_spot_borrow_amount(&self, coin: &str) -> Result<Decimal>
Sourcepub async fn borrow_spot(
&self,
coin: &str,
amount: Quantity,
) -> Result<BybitBorrowResponse>
pub async fn borrow_spot( &self, coin: &str, amount: Quantity, ) -> Result<BybitBorrowResponse>
Borrows coins for spot margin trading.
This should be called before opening short spot positions.
§Parameters
coin: The coin to repay (e.g., “BTC”, “ETH”)amount: Optional amount to borrow. If None, repays all outstanding borrows.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- Insufficient collateral for the borrow.
Sourcepub async fn repay_spot_borrow(
&self,
coin: &str,
amount: Option<Quantity>,
) -> Result<BybitNoConvertRepayResponse>
pub async fn repay_spot_borrow( &self, coin: &str, amount: Option<Quantity>, ) -> Result<BybitNoConvertRepayResponse>
Repays spot borrows for a specific coin.
This should be called after closing short spot positions to avoid accruing interest.
§Parameters
coin: The coin to repay (e.g., “BTC”, “ETH”)amount: Optional amount to repay. If None, repays all outstanding borrows.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- Called between 04:00-05:30 UTC (interest calculation window).
- Insufficient spot balance for repayment.
Sourcepub async fn submit_order(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: InstrumentId,
client_order_id: ClientOrderId,
order_side: OrderSide,
order_type: OrderType,
quantity: Quantity,
time_in_force: TimeInForce,
price: Option<Price>,
reduce_only: bool,
is_leverage: bool,
) -> Result<OrderStatusReport>
pub async fn submit_order( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: InstrumentId, client_order_id: ClientOrderId, order_side: OrderSide, order_type: OrderType, quantity: Quantity, time_in_force: TimeInForce, price: Option<Price>, reduce_only: bool, is_leverage: bool, ) -> Result<OrderStatusReport>
Submit a new order.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- Order validation fails.
- The order is rejected.
- The API returns an error.
Sourcepub async fn cancel_order(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: InstrumentId,
client_order_id: Option<ClientOrderId>,
venue_order_id: Option<VenueOrderId>,
) -> Result<OrderStatusReport>
pub async fn cancel_order( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: InstrumentId, client_order_id: Option<ClientOrderId>, venue_order_id: Option<VenueOrderId>, ) -> Result<OrderStatusReport>
Cancel an order.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- The order doesn’t exist.
- The API returns an error.
Sourcepub async fn batch_cancel_orders(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_ids: Vec<InstrumentId>,
client_order_ids: Vec<Option<ClientOrderId>>,
venue_order_ids: Vec<Option<VenueOrderId>>,
) -> Result<Vec<OrderStatusReport>>
pub async fn batch_cancel_orders( &self, account_id: AccountId, product_type: BybitProductType, instrument_ids: Vec<InstrumentId>, client_order_ids: Vec<Option<ClientOrderId>>, venue_order_ids: Vec<Option<VenueOrderId>>, ) -> Result<Vec<OrderStatusReport>>
Batch cancel multiple orders.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- Any of the orders don’t exist.
- The API returns an error.
Sourcepub async fn cancel_all_orders(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: InstrumentId,
) -> Result<Vec<OrderStatusReport>>
pub async fn cancel_all_orders( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: InstrumentId, ) -> Result<Vec<OrderStatusReport>>
Cancel all orders for an instrument.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- The API returns an error.
Sourcepub async fn modify_order(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: InstrumentId,
client_order_id: Option<ClientOrderId>,
venue_order_id: Option<VenueOrderId>,
quantity: Option<Quantity>,
price: Option<Price>,
) -> Result<OrderStatusReport>
pub async fn modify_order( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: InstrumentId, client_order_id: Option<ClientOrderId>, venue_order_id: Option<VenueOrderId>, quantity: Option<Quantity>, price: Option<Price>, ) -> Result<OrderStatusReport>
Modify an existing order.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- The order doesn’t exist.
- The order is already closed.
- The API returns an error.
Sourcepub async fn query_order(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: InstrumentId,
client_order_id: Option<ClientOrderId>,
venue_order_id: Option<VenueOrderId>,
) -> Result<Option<OrderStatusReport>>
pub async fn query_order( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: InstrumentId, client_order_id: Option<ClientOrderId>, venue_order_id: Option<VenueOrderId>, ) -> Result<Option<OrderStatusReport>>
Query a single order by client order ID or venue order ID.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- The API returns an error.
Sourcepub async fn request_instruments(
&self,
product_type: BybitProductType,
symbol: Option<String>,
) -> Result<Vec<InstrumentAny>>
pub async fn request_instruments( &self, product_type: BybitProductType, symbol: Option<String>, ) -> Result<Vec<InstrumentAny>>
Request instruments for a given product type.
§Errors
Returns an error if the request fails or parsing fails.
Sourcepub async fn request_trades(
&self,
product_type: BybitProductType,
instrument_id: InstrumentId,
limit: Option<u32>,
) -> Result<Vec<TradeTick>>
pub async fn request_trades( &self, product_type: BybitProductType, instrument_id: InstrumentId, limit: Option<u32>, ) -> Result<Vec<TradeTick>>
Request recent trade tick history for a given symbol.
Returns the most recent public trades from Bybit’s /v5/market/recent-trade endpoint.
This endpoint only provides recent trades (up to 1000 most recent), typically covering
only the last few minutes for active markets.
Note: For historical trade data with time ranges, use the klines endpoint instead. The Bybit public API does not support fetching historical trades by time range.
§Errors
Returns an error if:
- The instrument is not found in cache.
- The request fails.
- Parsing fails.
§References
https://bybit-exchange.github.io/docs/v5/market/recent-trade
Sourcepub async fn request_bars(
&self,
product_type: BybitProductType,
bar_type: BarType,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<u32>,
timestamp_on_close: bool,
) -> Result<Vec<Bar>>
pub async fn request_bars( &self, product_type: BybitProductType, bar_type: BarType, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<u32>, timestamp_on_close: bool, ) -> Result<Vec<Bar>>
Sourcepub async fn request_fee_rates(
&self,
product_type: BybitProductType,
symbol: Option<String>,
base_coin: Option<String>,
) -> Result<Vec<BybitFeeRate>>
pub async fn request_fee_rates( &self, product_type: BybitProductType, symbol: Option<String>, base_coin: Option<String>, ) -> Result<Vec<BybitFeeRate>>
Sourcepub async fn request_account_state(
&self,
account_type: BybitAccountType,
account_id: AccountId,
) -> Result<AccountState>
pub async fn request_account_state( &self, account_type: BybitAccountType, account_id: AccountId, ) -> Result<AccountState>
Requests the current account state for the specified account type.
§Errors
Returns an error if:
- The request fails.
- Parsing fails.
§References
https://bybit-exchange.github.io/docs/v5/account/wallet-balance
Sourcepub async fn request_order_status_reports(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: Option<InstrumentId>,
open_only: bool,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
limit: Option<u32>,
) -> Result<Vec<OrderStatusReport>>
pub async fn request_order_status_reports( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: Option<InstrumentId>, open_only: bool, start: Option<DateTime<Utc>>, end: Option<DateTime<Utc>>, limit: Option<u32>, ) -> Result<Vec<OrderStatusReport>>
Request multiple order status reports.
Orders for instruments not currently loaded in cache will be skipped.
§Errors
Returns an error if:
- Credentials are missing.
- The request fails.
- The API returns an error.
Sourcepub async fn request_fill_reports(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: Option<InstrumentId>,
start: Option<i64>,
end: Option<i64>,
limit: Option<u32>,
) -> Result<Vec<FillReport>>
pub async fn request_fill_reports( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: Option<InstrumentId>, start: Option<i64>, end: Option<i64>, limit: Option<u32>, ) -> Result<Vec<FillReport>>
Fetches execution history (fills) for the account and returns a list of FillReports.
Executions for instruments not currently loaded in cache will be skipped.
§Errors
This function returns an error if the request fails.
§References
Sourcepub async fn request_position_status_reports(
&self,
account_id: AccountId,
product_type: BybitProductType,
instrument_id: Option<InstrumentId>,
) -> Result<Vec<PositionStatusReport>>
pub async fn request_position_status_reports( &self, account_id: AccountId, product_type: BybitProductType, instrument_id: Option<InstrumentId>, ) -> Result<Vec<PositionStatusReport>>
Fetches position information for the account and returns a list of PositionStatusReports.
Positions for instruments not currently loaded in cache will be skipped.
§Errors
This function returns an error if the request fails.
§References
Source§impl BybitHttpClient
impl BybitHttpClient
pub fn py_base_url(&self) -> &str
pub fn py_api_key(&self) -> Option<&str>
pub fn py_api_key_masked(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for BybitHttpClient
impl Clone for BybitHttpClient
Source§impl Debug for BybitHttpClient
impl Debug for BybitHttpClient
Source§impl Default for BybitHttpClient
impl Default for BybitHttpClient
Source§impl<'py> IntoPyObject<'py> for BybitHttpClient
impl<'py> IntoPyObject<'py> for BybitHttpClient
Source§type Target = BybitHttpClient
type Target = BybitHttpClient
Source§type Output = Bound<'py, <BybitHttpClient as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <BybitHttpClient as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for BybitHttpClient
impl PyClass for BybitHttpClient
Source§impl PyClassImpl for BybitHttpClient
impl PyClassImpl for BybitHttpClient
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Provides a HTTP client for connecting to the [Bybit](https://bybit.com) REST API.
#[cfg_attr(
feature = "python",
pyo3::pyclass(module = "nautilus_trader.core.nautilus_pyo3.adapters")
)]
/// High-level HTTP client that wraps the raw client and provides Nautilus domain types.
///
/// This client maintains an instrument cache and uses it to parse venue responses
/// into Nautilus domain objects.
const RAW_DOC: &'static CStr = /// Provides a HTTP client for connecting to the [Bybit](https://bybit.com) REST API. #[cfg_attr( feature = "python", pyo3::pyclass(module = "nautilus_trader.core.nautilus_pyo3.adapters") )] /// High-level HTTP client that wraps the raw client and provides Nautilus domain types. /// /// This client maintains an instrument cache and uses it to parse venue responses /// into Nautilus domain objects.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<BybitHttpClient>
type ThreadChecker = SendablePyClass<BybitHttpClient>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for BybitHttpClient
impl PyClassNewTextSignature for BybitHttpClient
const TEXT_SIGNATURE: &'static str = "(api_key=None, api_secret=None, base_url=None, demo=False, testnet=False, timeout_secs=None, max_retries=None, retry_delay_ms=None, retry_delay_max_ms=None, recv_window_ms=None, proxy_url=None)"
Source§impl PyMethods<BybitHttpClient> for PyClassImplCollector<BybitHttpClient>
impl PyMethods<BybitHttpClient> for PyClassImplCollector<BybitHttpClient>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for BybitHttpClient
impl PyTypeInfo for BybitHttpClient
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.impl DerefToPyAny for BybitHttpClient
impl ExtractPyClassWithClone for BybitHttpClient
Auto Trait Implementations§
impl Freeze for BybitHttpClient
impl !RefUnwindSafe for BybitHttpClient
impl Send for BybitHttpClient
impl Sync for BybitHttpClient
impl Unpin for BybitHttpClient
impl !UnwindSafe for BybitHttpClient
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
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read moreSource§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
Source§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more