Skip to main content

OptionData

Struct OptionData 

Source
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 be None if market data is unavailable.
  • call_ask - The ask price for the call option, represented as an optional positive floating-point number. May be None if market data is unavailable.
  • put_bid - The bid price for the put option, represented as an optional positive floating-point number. May be None if market data is unavailable.
  • put_ask - The ask price for the put option, represented as an optional positive floating-point number. May be None if market data is unavailable.
  • call_middle - The mid-price between call bid and ask, represented as an optional positive floating-point number. May be None if 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 be None if underlying bid/ask data is unavailable.
  • implied_volatility - The implied volatility of the option, represented as an optional positive floating-point number. May be None if 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 be None if 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 a FourOptions struct 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: Positive

The 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: Positive

The 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 the Positive type 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

Source

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. None if market data is unavailable.
  • call_ask - The ask price for the call option. None if market data is unavailable.
  • put_bid - The bid price for the put option. None if market data is unavailable.
  • put_ask - The ask price for the put option. None if market data is unavailable.
  • implied_volatility - The implied volatility derived from option prices. None if 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.

Source

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 both call_bid and call_ask are present.
  • None if either call_bid or call_ask is None.
§Note

The Positive type is assumed to enforce non-negative values for correctness.

Source

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 both call_bid and call_ask values are available and non-negative.
  • Returns None if either call_bid or call_ask is missing.
§Notes
  • The method assumes both call_bid and call_ask are non-negative.
  • Positive is 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.

Source

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 both put_bid and put_ask are Some, containing their calculated spread.
  • None if either put_bid or put_ask is None.
§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.

Source

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 both put_bid and put_ask are present, containing the percentage spread.
  • None if either put_bid or put_ask is unavailable.
§Assumptions
  • put_bid and put_ask are non-negative.
  • The Positive type 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.

Source

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.
  • None if 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.

Source

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.
Source

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.
Source

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:

  1. The strike price is not zero
  2. Implied volatility is present
  3. Call option data is valid (via valid_call())
  4. 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 valid
  • false - If any validation check fails, indicating the option data is incomplete or invalid
Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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 in OptionDataPriceParams.
  • side - The side of the option, either Side::Long or Side::Short.
  • option_style - The style of the option, either OptionStyle::Call or OptionStyle::Put.
  • date - An optional DateTime<Utc> representing the opening date of the position. If None, the current UTC timestamp is used.
  • open_fee - An optional Positive value representing the opening fee for the position. If None, defaults to Positive::ZERO.
  • close_fee - An optional Positive value representing the closing fee for the position. If None, defaults to Positive::ZERO.
§Returns
  • Result<Position, ChainError> - A Result containing the constructed Position on success, or a ChainError if 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.
Source

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 to OptionDataPriceParams containing 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 to true, the method will recreate the option contracts before calculating prices.

§Returns
  • Result<(), ChainError> - Returns Ok(()) if prices are successfully calculated and set, or a ChainError if any error occurs during the process.
§Side Effects

Sets the following fields in the struct:

  • call_ask - The ask price for the call option
  • call_bid - The bid price for the call option
  • put_ask - The ask price for the put option
  • put_bid - The bid price for the put option
  • call_middle and put_middle - The mid-prices calculated via set_mid_prices()
§Errors

May return:

  • ChainError variants if there are issues creating the options contracts
  • Errors propagated from the Black-Scholes calculation functions
Source

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 apply
  • decimal_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, and put_bid fields with adjusted values
  • Sets adjusted prices to None if they would become negative after applying the spread
  • Calls set_mid_prices() to recalculate the mid prices based on the new bid/ask values
Source

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.

Source

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.

Source

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 ChainError if there’s an issue retrieving the options or calculating their deltas.
  • Possible errors include missing option data, calculation failures, or invalid parameters.
Source

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 a Positive value.
  • 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)
Source

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.

Source

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 None if not available
  • Second element: The put option mid-price (bid+ask)/2, or None if not available
Source

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 be None if the delta value is not available or could not be calculated.
  • Second element: Option<Decimal> - The delta value for the put option. May be None if the delta value is not available or could not be calculated.
Source

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 in Some if it exists, or None if the gamma value is not set.

Trait Implementations§

Source§

impl Clone for OptionData

Source§

fn clone(&self) -> OptionData

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

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

Performs copy-assignment from source. Read more
Source§

impl ComposeSchema for OptionData

Source§

impl Debug for OptionData

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for OptionData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OptionData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for OptionData

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for OptionData

Source§

impl Ord for OptionData

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for OptionData

Source§

fn eq(&self, other: &OptionData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for OptionData

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for OptionData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for OptionData

Source§

impl ToSchema for OptionData

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more
Source§

impl TryFrom<&OptionData> for Options

Source§

type Error = OptionsError

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

fn try_from(option_data: &OptionData) -> Result<Self, Self::Error>

Performs the conversion.

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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