pub struct OptionData {Show 20 fields
pub strike_price: Positive,
pub call_bid: Option<Positive>,
pub call_ask: Option<Positive>,
pub put_bid: Option<Positive>,
pub put_ask: Option<Positive>,
pub call_middle: Option<Positive>,
pub put_middle: Option<Positive>,
pub implied_volatility: Positive,
pub delta_call: Option<Decimal>,
pub delta_put: Option<Decimal>,
pub gamma: Option<Decimal>,
pub volume: Option<Positive>,
pub open_interest: Option<u64>,
pub symbol: Option<String>,
pub expiration_date: Option<ExpirationDate>,
pub underlying_price: Option<Box<Positive>>,
pub risk_free_rate: Option<Decimal>,
pub dividend_yield: Option<Positive>,
pub epic: Option<String>,
pub extra_fields: Option<Value>,
}Expand description
Struct representing a row in an option chain with detailed pricing and analytics data.
This struct encapsulates the complete market data for an options contract at a specific strike price, including bid/ask prices for both call and put options, implied volatility, the Greeks (delta, gamma), volume, and open interest. It provides all the essential information needed for options analysis and trading decision-making.
§Fields
strike_price- The strike price of the option, represented as a positive floating-point number.call_bid- The bid price for the call option, represented as an optional positive floating-point number. May beNoneif market data is unavailable.call_ask- The ask price for the call option, represented as an optional positive floating-point number. May beNoneif market data is unavailable.put_bid- The bid price for the put option, represented as an optional positive floating-point number. May beNoneif market data is unavailable.put_ask- The ask price for the put option, represented as an optional positive floating-point number. May beNoneif market data is unavailable.call_middle- The mid-price between call bid and ask, represented as an optional positive floating-point number. May beNoneif underlying bid/ask data is unavailable.put_middle- The mid-price between put bid and ask, represented as an optional positive floating-point number. May beNoneif underlying bid/ask data is unavailable.implied_volatility- The implied volatility of the option, represented as an optional positive floating-point number. May beNoneif it cannot be calculated from available market data.delta_call- The delta of the call option, represented as an optional decimal number. Measures the rate of change of the option price with respect to changes in the underlying asset price.delta_put- The delta of the put option, represented as an optional decimal number. Measures the rate of change of the option price with respect to changes in the underlying asset price.gamma- The gamma of the option, represented as an optional decimal number. Measures the rate of change of delta with respect to changes in the underlying asset price.volume- The trading volume of the option, represented as an optional positive floating-point number. May beNoneif data is not available.open_interest- The open interest of the option, represented as an optional unsigned integer. Represents the total number of outstanding option contracts that have not been settled.options- An optional boxed reference to aFourOptionsstruct that may contain the actual option contracts represented by this data. This field is not serialized.
§Usage
This struct is typically used to represent a single row in an option chain table, providing comprehensive market data for options at a specific strike price. It’s useful for option pricing models, strategy analysis, and trading applications.
§Serialization
This struct implements Serialize and Deserialize traits, with fields that are None
being skipped during serialization to produce more compact JSON output.
Fields§
§strike_price: PositiveThe strike price of the option, represented as a positive floating-point number.
call_bid: Option<Positive>The bid price for the call option. May be None if market data is unavailable.
call_ask: Option<Positive>The ask price for the call option. May be None if market data is unavailable.
put_bid: Option<Positive>The bid price for the put option. May be None if market data is unavailable.
put_ask: Option<Positive>The ask price for the put option. May be None if market data is unavailable.
call_middle: Option<Positive>The mid-price between call bid and ask. Calculated as (bid + ask) / 2.
put_middle: Option<Positive>The mid-price between put bid and ask. Calculated as (bid + ask) / 2.
implied_volatility: PositiveThe implied_volatility field represents the implied volatility value, which is of type Positive.
This value is intended to store a positive number, as enforced by the Positive type.
§Attributes
#[serde(default)]: This attribute ensures that the field is given a default value during deserialization if the value is not provided. The default implementation for thePositivetype is expected to supply an appropriate default positive value.
§Type
Positive: A type that ensures the value it holds is strictly positive.
§Usage
This field is commonly utilized in contexts where implied volatility is required, such as in financial modeling or derivative pricing calculations. Deserialization will automatically manage its default value if it is absent from the data source.
delta_call: Option<Decimal>The delta of the call option, measuring price sensitivity to underlying changes.
delta_put: Option<Decimal>The delta of the put option, measuring price sensitivity to underlying changes.
gamma: Option<Decimal>The gamma of the option, measuring the rate of change in delta.
volume: Option<Positive>The trading volume of the option, indicating market activity.
open_interest: Option<u64>The open interest, representing the number of outstanding contracts.
symbol: Option<String>The symbol of the underlying asset.
expiration_date: Option<ExpirationDate>The expiration date of the option contract.
underlying_price: Option<Box<Positive>>The price of the underlying asset.
risk_free_rate: Option<Decimal>The risk-free interest rate used for option pricing.
dividend_yield: Option<Positive>The dividend yield of the underlying asset.
epic: Option<String>The epic identifier for the option contract, used for trading platforms.
extra_fields: Option<Value>Additional fields that may be included in the option data.
Implementations§
Source§impl OptionData
impl OptionData
Sourcepub fn new(
strike_price: Positive,
call_bid: Option<Positive>,
call_ask: Option<Positive>,
put_bid: Option<Positive>,
put_ask: Option<Positive>,
implied_volatility: Positive,
delta_call: Option<Decimal>,
delta_put: Option<Decimal>,
gamma: Option<Decimal>,
volume: Option<Positive>,
open_interest: Option<u64>,
symbol: Option<String>,
expiration_date: Option<ExpirationDate>,
underlying_price: Option<Box<Positive>>,
risk_free_rate: Option<Decimal>,
dividend_yield: Option<Positive>,
epic: Option<String>,
extra_fields: Option<Value>,
) -> Self
pub fn new( strike_price: Positive, call_bid: Option<Positive>, call_ask: Option<Positive>, put_bid: Option<Positive>, put_ask: Option<Positive>, implied_volatility: Positive, delta_call: Option<Decimal>, delta_put: Option<Decimal>, gamma: Option<Decimal>, volume: Option<Positive>, open_interest: Option<u64>, symbol: Option<String>, expiration_date: Option<ExpirationDate>, underlying_price: Option<Box<Positive>>, risk_free_rate: Option<Decimal>, dividend_yield: Option<Positive>, epic: Option<String>, extra_fields: Option<Value>, ) -> Self
Creates a new instance of OptionData with the given option market parameters.
This constructor creates an OptionData structure that represents a single row in an options chain,
containing market data for both call and put options at a specific strike price. The middle prices
for calls and puts are initially set to None and can be calculated later if needed.
§Parameters
strike_price- The strike price of the option contract, guaranteed to be positive.call_bid- The bid price for the call option.Noneif market data is unavailable.call_ask- The ask price for the call option.Noneif market data is unavailable.put_bid- The bid price for the put option.Noneif market data is unavailable.put_ask- The ask price for the put option.Noneif market data is unavailable.implied_volatility- The implied volatility derived from option prices.Noneif not calculable.delta_call- The delta of the call option, measuring price sensitivity to underlying changes.delta_put- The delta of the put option, measuring price sensitivity to underlying changes.gamma- The gamma of the option, measuring the rate of change in delta.volume- The trading volume of the option, indicating market activity.open_interest- The number of outstanding option contracts that have not been settled.
§Returns
A new OptionData instance with the specified parameters and with call_middle, put_middle,
and options fields initialized to None.
§Note
This function allows many optional parameters to accommodate scenarios where not all market data is available from data providers.
Sourcepub fn get_call_spread(&self) -> Option<Positive>
pub fn get_call_spread(&self) -> Option<Positive>
Calculates and returns the call spread as a Positive value if both call bid and call ask
prices are available. Otherwise, returns None.
The call spread is determined as the absolute difference between the call ask price and the call bid price.
§Returns
Some(Positive)if bothcall_bidandcall_askare present.Noneif eithercall_bidorcall_askisNone.
§Note
The Positive type is assumed to enforce non-negative values for correctness.
Sourcepub fn get_call_spread_per(&self) -> Option<Positive>
pub fn get_call_spread_per(&self) -> Option<Positive>
Calculates the percentage call spread based on the bid and ask prices of a call option.
§Formula
The call spread percentage is computed using the absolute difference between the call ask price and the call bid price, divided by the mid price of the call. Mathematically:
Spread% = |CallAsk - CallBid| / ((CallAsk + CallBid) / 2)§Returns
- Returns
Some(Positive)if bothcall_bidandcall_askvalues are available and non-negative. - Returns
Noneif eithercall_bidorcall_askis missing.
§Notes
- The method assumes both
call_bidandcall_askare non-negative. Positiveis a custom type encapsulating non-negative values.- The resulting percentage is always positive due to the use of
.abs()for the spread calculation.
§Parameters
None (relies on internal self.call_bid and self.call_ask properties).
§Errors
This function does not return an error. It simply returns None if the calculation is not feasible.
Sourcepub fn get_put_spread(&self) -> Option<Positive>
pub fn get_put_spread(&self) -> Option<Positive>
Calculates and returns the spread between put_bid and put_ask if both values are present.
The spread is calculated as the absolute difference between the put_ask price and the
put_bid price. The result is wrapped in a Positive type.
§Returns
Some(Positive)if bothput_bidandput_askareSome, containing their calculated spread.Noneif eitherput_bidorput_askisNone.
§Note
The values of put_bid and put_ask must implement the to_dec() method
to convert to a numeric type for calculation purposes.
The spread is always represented as a positive value.
Sourcepub fn get_put_spread_per(&self) -> Option<Positive>
pub fn get_put_spread_per(&self) -> Option<Positive>
Calculates the percentage spread of the bid and ask prices for a put option.
The function computes the absolute difference (spread) between the bid and ask prices.
It then divides this spread by the midpoint of the bid and ask prices to yield the
percentage spread. Only positive values are returned wrapped in the Positive type.
§Returns
Some(Positive)if bothput_bidandput_askare present, containing the percentage spread.Noneif eitherput_bidorput_askis unavailable.
§Assumptions
put_bidandput_askare non-negative.- The
Positivetype is a wrapper that ensures the value is greater than zero.
§Note
This function returns None if there are missing values for either put_bid or put_ask.
Sourcepub fn get_volatility(&self) -> Positive
pub fn get_volatility(&self) -> Positive
Retrieves the implied volatility of the underlying asset or option.
§Returns
An Option<Positive> where:
Some(Positive)contains the implied volatility if it is available.Noneif the implied volatility is not set or available.
§Notes
The implied volatility represents the market’s forecast of a likely movement in an asset’s price and is often used in option pricing models.
Ensure that the Positive type enforces constraints to prevent invalid values
such as negative volatility.
Sourcepub fn set_volatility(&mut self, volatility: &Positive)
pub fn set_volatility(&mut self, volatility: &Positive)
Sets the implied volatility for this option contract.
§Arguments
volatility- A positive decimal value representing the implied volatility.
Sourcepub fn set_extra_params(&mut self, params: OptionDataPriceParams)
pub fn set_extra_params(&mut self, params: OptionDataPriceParams)
Sets additional pricing parameters for this option contract.
This method updates the option data with the provided pricing parameters, including underlying symbol, price, expiration date, risk-free rate, and dividend yield.
§Arguments
params- The pricing parameters to set.
Sourcepub fn validate(&self) -> bool
pub fn validate(&self) -> bool
Validates the option data to ensure it meets the required criteria for calculations.
This method performs a series of validation checks to ensure that the option data is complete and valid for further processing or analysis. It verifies:
- The strike price is not zero
- Implied volatility is present
- Call option data is valid (via
valid_call()) - Put option data is valid (via
valid_put())
Each validation failure is logged as an error for debugging and troubleshooting.
§Returns
true- If all validation checks pass, indicating the option data is validfalse- If any validation check fails, indicating the option data is incomplete or invalid
Sourcepub fn strike(&self) -> Positive
pub fn strike(&self) -> Positive
Retrieves the strike price.
This method returns the strike price associated with the object. The strike price
is represented as a Positive value, ensuring that it is always greater than zero.
§Returns
Positive- The strike price of the object.
§Notes
The method assumes that the strike price has been properly initialized and is a valid positive number.
Sourcepub fn get_call_buy_price(&self) -> Option<Positive>
pub fn get_call_buy_price(&self) -> Option<Positive>
Retrieves the price at which a call option can be purchased.
This method returns the ask price for a call option, which is the price a buyer would pay to purchase the call option.
§Returns
The call option’s ask price as a Positive value, or None if the price is unavailable.
Sourcepub fn get_call_sell_price(&self) -> Option<Positive>
pub fn get_call_sell_price(&self) -> Option<Positive>
Retrieves the price at which a call option can be sold.
This method returns the bid price for a call option, which is the price a seller would receive when selling the call option.
§Returns
The call option’s bid price as a Positive value, or None if the price is unavailable.
Sourcepub fn get_put_buy_price(&self) -> Option<Positive>
pub fn get_put_buy_price(&self) -> Option<Positive>
Retrieves the price at which a put option can be purchased.
This method returns the ask price for a put option, which is the price a buyer would pay to purchase the put option.
§Returns
The put option’s ask price as a Positive value, or None if the price is unavailable.
Sourcepub fn get_put_sell_price(&self) -> Option<Positive>
pub fn get_put_sell_price(&self) -> Option<Positive>
Retrieves the price at which a put option can be sold.
This method returns the bid price for a put option, which is the price a seller would receive when selling the put option.
§Returns
The put option’s bid price as a Positive value, or None if the price is unavailable.
Sourcepub fn some_price_is_none(&self) -> bool
pub fn some_price_is_none(&self) -> bool
Checks if any of the bid or ask prices for call or put options are None.
This function returns true if any of the call_bid, call_ask, put_bid, or put_ask
fields of the OptionData struct are None, indicating missing price information.
It returns false if all four fields have valid price data.
Sourcepub fn get_position(
&self,
side: Side,
option_style: OptionStyle,
date: Option<DateTime<Utc>>,
open_fee: Option<Positive>,
close_fee: Option<Positive>,
) -> Result<Position, ChainError>
pub fn get_position( &self, side: Side, option_style: OptionStyle, date: Option<DateTime<Utc>>, open_fee: Option<Positive>, close_fee: Option<Positive>, ) -> Result<Position, ChainError>
Retrieves a Position based on the provided parameters, calculating the option premium using the Black-Scholes model.
This method fetches an option based on the provided parameters, calculates its theoretical
premium using the Black-Scholes model, and constructs a Position struct containing the option
details, premium, opening date, and associated fees.
§Arguments
price_params- Option pricing parameters encapsulated inOptionDataPriceParams.side- The side of the option, eitherSide::LongorSide::Short.option_style- The style of the option, eitherOptionStyle::CallorOptionStyle::Put.date- An optionalDateTime<Utc>representing the opening date of the position. IfNone, the current UTC timestamp is used.open_fee- An optionalPositivevalue representing the opening fee for the position. IfNone, defaults toPositive::ZERO.close_fee- An optionalPositivevalue representing the closing fee for the position. IfNone, defaults toPositive::ZERO.
§Returns
Result<Position, ChainError>- AResultcontaining the constructedPositionon success, or aChainErrorif any error occurred during option retrieval or premium calculation.
§Errors
This method can return a ChainError if:
- The underlying option cannot be retrieved based on the provided parameters.
- The Black-Scholes model fails to calculate a valid option premium.
Sourcepub fn calculate_prices(
&mut self,
spread: Option<Positive>,
) -> Result<(), ChainError>
pub fn calculate_prices( &mut self, spread: Option<Positive>, ) -> Result<(), ChainError>
Calculates and sets the bid and ask prices for call and put options.
This method computes the theoretical prices for both call and put options using the
Black-Scholes pricing model, and then stores these values in the appropriate fields.
After calculating the individual bid and ask prices, it also computes and sets the
mid-prices by calling the set_mid_prices method.
§Parameters
-
price_params- A reference toOptionDataPriceParamscontaining the necessary parameters for option pricing, such as underlying price, volatility, risk-free rate, expiration date, and dividend yield. -
refresh- A boolean flag indicating whether to force recalculation of option contracts even if they already exist. When set totrue, the method will recreate the option contracts before calculating prices.
§Returns
Result<(), ChainError>- ReturnsOk(())if prices are successfully calculated and set, or aChainErrorif any error occurs during the process.
§Side Effects
Sets the following fields in the struct:
call_ask- The ask price for the call optioncall_bid- The bid price for the call optionput_ask- The ask price for the put optionput_bid- The bid price for the put optioncall_middleandput_middle- The mid-prices calculated viaset_mid_prices()
§Errors
May return:
ChainErrorvariants if there are issues creating the options contracts- Errors propagated from the Black-Scholes calculation functions
Sourcepub fn apply_spread(&mut self, spread: Positive, decimal_places: u32)
pub fn apply_spread(&mut self, spread: Positive, decimal_places: u32)
Applies a spread to the bid and ask prices of call and put options, then recalculates mid prices.
This method adjusts the bid and ask prices by half of the specified spread value,
subtracting from bid prices and adding to ask prices. It also ensures that all prices
are rounded to the specified number of decimal places. If any price becomes negative
after applying the spread, it is set to None.
§Arguments
spread- A positive decimal value representing the total spread to applydecimal_places- The number of decimal places to round the adjusted prices to
§Inner Function
The method contains an inner function round_to_decimal that handles the rounding
of prices after applying a shift (half the spread).
§Side Effects
- Updates
call_ask,call_bid,put_ask, andput_bidfields with adjusted values - Sets adjusted prices to
Noneif they would become negative after applying the spread - Calls
set_mid_prices()to recalculate the mid prices based on the new bid/ask values
Sourcepub fn calculate_delta(&mut self)
pub fn calculate_delta(&mut self)
Calculates the delta of the option and stores it in the option data.
Delta measures the rate of change of the option price with respect to changes in the underlying asset’s price. This method creates a Call option and uses it to calculate the delta value.
Sourcepub fn calculate_gamma(&mut self)
pub fn calculate_gamma(&mut self)
Calculates the gamma of the option and stores it in the option data.
Gamma measures the rate of change of delta with respect to changes in the underlying asset’s price. This method creates a Call option and uses it to calculate the gamma value.
Sourcepub fn get_deltas(&self) -> Result<DeltasInStrike, ChainError>
pub fn get_deltas(&self) -> Result<DeltasInStrike, ChainError>
Retrieves delta values for options at the current strike price.
Delta measures the rate of change of the option price with respect to changes in the underlying asset’s price. This method returns delta values for options at the specific strike price defined in the price parameters.
§Parameters
price_params- A reference to the pricing parameters required for option calculations, including underlying price, expiration date, risk-free rate and other inputs.
§Returns
Result<DeltasInStrike, ChainError>- On success, returns a structure containing delta values for the options at the specified strike. On failure, returns a ChainError describing the issue.
§Errors
- Returns a
ChainErrorif there’s an issue retrieving the options or calculating their deltas. - Possible errors include missing option data, calculation failures, or invalid parameters.
Sourcepub fn is_valid_optimal_side(
&self,
underlying_price: &Positive,
side: &FindOptimalSide,
) -> bool
pub fn is_valid_optimal_side( &self, underlying_price: &Positive, side: &FindOptimalSide, ) -> bool
Validates if an option strike price is valid according to the specified search strategy.
This method checks whether the current option’s strike price falls within the constraints
defined by the FindOptimalSide parameter, relative to the given underlying asset price.
§Parameters
underlying_price- The current market price of the underlying asset as aPositivevalue.side- The strategy to determine valid strike prices, specifying whether to consider options with strikes above, below, or within a specific range of the underlying price.
§Returns
bool - Returns true if the strike price is valid according to the specified strategy:
- For
Upper: Strike price must be greater than or equal to underlying price - For
Lower: Strike price must be less than or equal to underlying price - For
All: Always returns true (all strike prices are valid) - For
Range: Strike price must fall within the specified range (inclusive)
Sourcepub fn set_mid_prices(&mut self)
pub fn set_mid_prices(&mut self)
Calculates and sets the mid-prices for both call and put options.
This method computes the middle price between the bid and ask prices for
both call and put options, when both bid and ask prices are available.
The mid-price is calculated as the simple average: (bid + ask) / 2.
If either bid or ask price is missing for an option type, the corresponding
mid-price will be set to None.
§Side Effects
Updates the call_middle and put_middle fields with the calculated mid-prices.
Sourcepub fn get_mid_prices(&self) -> (Option<Positive>, Option<Positive>)
pub fn get_mid_prices(&self) -> (Option<Positive>, Option<Positive>)
Retrieves the current mid-prices for call and put options.
This method returns the calculated middle prices for both call and put options
as a tuple. Each price may be None if the corresponding bid/ask prices
were not available when set_mid_prices() was called.
§Returns
A tuple containing:
- First element: The call option mid-price (bid+ask)/2, or
Noneif not available - Second element: The put option mid-price (bid+ask)/2, or
Noneif not available
Sourcepub fn current_deltas(&self) -> (Option<Decimal>, Option<Decimal>)
pub fn current_deltas(&self) -> (Option<Decimal>, Option<Decimal>)
Returns a tuple containing the current delta values for both call and put options.
This method provides access to the option’s delta values, which measure the rate of change of the option price with respect to changes in the underlying asset price. Delta values typically range from -1 to 1 and are a key metric for understanding option price sensitivity.
§Returns
A tuple containing:
- First element:
Option<Decimal>- The delta value for the call option. May beNoneif the delta value is not available or could not be calculated. - Second element:
Option<Decimal>- The delta value for the put option. May beNoneif the delta value is not available or could not be calculated.
Sourcepub fn current_gamma(&self) -> Option<Decimal>
pub fn current_gamma(&self) -> Option<Decimal>
Returns the current gamma value.
This function retrieves the optional gamma field of the struct.
If the gamma field has been set, it returns a Some(Decimal) value;
otherwise, it returns None.
§Returns
Option<Decimal>- The current gamma value wrapped inSomeif it exists, orNoneif the gamma value is not set.
Trait Implementations§
Source§impl Clone for OptionData
impl Clone for OptionData
Source§fn clone(&self) -> OptionData
fn clone(&self) -> OptionData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for OptionData
impl ComposeSchema for OptionData
Source§impl Debug for OptionData
impl Debug for OptionData
Source§impl Default for OptionData
impl Default for OptionData
Source§impl<'de> Deserialize<'de> for OptionData
impl<'de> Deserialize<'de> for OptionData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for OptionData
impl Display for OptionData
impl Eq for OptionData
Source§impl Ord for OptionData
impl Ord for OptionData
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OptionData
impl PartialEq for OptionData
Source§impl PartialOrd for OptionData
impl PartialOrd for OptionData
Source§impl Serialize for OptionData
impl Serialize for OptionData
impl StructuralPartialEq for OptionData
Source§impl ToSchema for OptionData
impl ToSchema for OptionData
Source§impl TryFrom<&OptionData> for Options
impl TryFrom<&OptionData> for Options
Source§type Error = OptionsError
type Error = OptionsError
Auto Trait Implementations§
impl Freeze for OptionData
impl RefUnwindSafe for OptionData
impl Send for OptionData
impl Sync for OptionData
impl Unpin for OptionData
impl UnsafeUnpin for OptionData
impl UnwindSafe for OptionData
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
impl<T> PartialSchema for Twhere
T: ComposeSchema + ?Sized,
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.