Skip to main content

CustomStrategy

Struct CustomStrategy 

Source
pub struct CustomStrategy {
    pub name: String,
    pub symbol: String,
    pub kind: StrategyType,
    pub description: String,
    pub break_even_points: Vec<Positive>,
    pub positions: Vec<Position>,
    pub underlying_price: Positive,
    /* private fields */
}
Expand description

Represents a custom options trading strategy with user-defined positions and characteristics.

The CustomStrategy struct allows traders to create and analyze bespoke options strategies that don’t fit into standard predefined patterns. It contains information about the strategy’s positions, risk-reward profile, break-even points, and provides methods for profit-loss analysis.

This structure supports both analytical calculations and visualization of custom strategies, enabling traders to evaluate potential outcomes across different price points of the underlying asset.

Fields§

§name: String

The name of the custom strategy.

§symbol: String

The ticker symbol of the underlying asset.

§kind: StrategyType

The type of strategy, typically set to StrategyType::Custom.

§description: String

A detailed description of the strategy, its purpose, and expected outcomes.

§break_even_points: Vec<Positive>

The price points at which the strategy breaks even (neither profit nor loss).

§positions: Vec<Position>

The collection of option positions that make up the strategy.

§underlying_price: Positive

The current price of the underlying asset.

Implementations§

Source§

impl CustomStrategy

Source

pub fn new( name: String, symbol: String, description: String, underlying_price: Positive, positions: Vec<Position>, epsilon: Positive, max_iterations: u32, step_by: Positive, ) -> Result<Self, StrategyError>

Creates a new custom options trading strategy with the specified parameters.

This constructor initializes a CustomStrategy instance and performs several validation and calculation steps to ensure the strategy is valid and properly analyzed before being returned to the caller.

§Parameters
  • name - The name of the custom strategy
  • symbol - The ticker symbol of the underlying asset
  • description - A detailed description of the strategy’s purpose and characteristics
  • underlying_price - The current price of the underlying asset
  • positions - A collection of option positions that compose the strategy
  • epsilon - Tolerance value used in numerical calculations for finding critical points
  • max_iterations - Maximum number of iterations allowed in numerical algorithms
  • step_by - Step size used in price interval calculations
§Returns

A fully initialized CustomStrategy instance with calculated break-even points, maximum profit, and maximum loss information.

§Errors

Returns StrategyError::OperationError when positions is empty, and propagates any error from update_break_even_points.

Trait Implementations§

Source§

impl BasicAble for CustomStrategy

Source§

fn get_title(&self) -> String

Retrieves the title associated with the current instance of the strategy. Read more
Source§

fn get_option_basic_type(&self) -> HashSet<OptionBasicType<'_>>

Retrieves a HashSet of OptionBasicType values associated with the current strategy. Read more
Source§

fn get_implied_volatility(&self) -> HashMap<OptionBasicType<'_>, &Positive>

Retrieves the implied volatility for the current strategy. Read more
Source§

fn get_quantity(&self) -> HashMap<OptionBasicType<'_>, &Positive>

Retrieves the quantity information associated with the strategy. Read more
Source§

fn one_option(&self) -> &Options

Retrieves a shared reference to the strategy’s primary Options value. Read more
Source§

fn one_option_mut(&mut self) -> &mut Options

Provides a mutable reference to the strategy’s primary Options value. Read more
Source§

fn set_expiration_date( &mut self, expiration_date: ExpirationDate, ) -> Result<(), StrategyError>

Sets the expiration date for the strategy. Read more
Source§

fn set_underlying_price( &mut self, price: &Positive, ) -> Result<(), StrategyError>

Sets the underlying price for this strategy. Read more
Source§

fn set_implied_volatility( &mut self, volatility: &Positive, ) -> Result<(), StrategyError>

Updates the volatility for the strategy. Read more
Source§

fn get_symbol(&self) -> &str

Retrieves the symbol associated with the current instance by delegating the call to the get_symbol method of the one_option object. Read more
Source§

fn get_strike(&self) -> HashMap<OptionBasicType<'_>, &Positive>

Retrieves a mapping of option basic types to their associated positive strike values. Read more
Source§

fn get_strikes(&self) -> Vec<&Positive>

Retrieves a vector of strike prices from the option types. Read more
Source§

fn get_side(&self) -> HashMap<OptionBasicType<'_>, &Side>

Retrieves a HashMap that maps each OptionBasicType to its corresponding Side. Read more
Source§

fn get_type(&self) -> &OptionType

Retrieves the type of the option. Read more
Source§

fn get_style(&self) -> HashMap<OptionBasicType<'_>, &OptionStyle>

Retrieves a mapping of OptionBasicType to their corresponding OptionStyle. Read more
Source§

fn get_expiration(&self) -> HashMap<OptionBasicType<'_>, &ExpirationDate>

Retrieves a map of option basic types to their corresponding expiration dates. Read more
Source§

fn get_underlying_price(&self) -> &Positive

Retrieves the underlying price of the financial instrument (e.g., option). Read more
Source§

fn get_risk_free_rate(&self) -> HashMap<OptionBasicType<'_>, &Decimal>

Retrieves the risk-free interest rate associated with a given set of options. Read more
Source§

fn get_dividend_yield(&self) -> HashMap<OptionBasicType<'_>, &Positive>

Retrieves the dividend yield of a financial option. Read more
Source§

impl BreakEvenable for CustomStrategy

Source§

fn get_break_even_points(&self) -> Result<&Vec<Positive>, StrategyError>

Retrieves the break-even points for the strategy. Read more
Source§

fn update_break_even_points(&mut self) -> Result<(), StrategyError>

Updates the break-even points for the strategy. Read more
Source§

impl Clone for CustomStrategy

Source§

fn clone(&self) -> CustomStrategy

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 CustomStrategy

Source§

impl Debug for CustomStrategy

Source§

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

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

impl DeltaNeutrality for CustomStrategy

Source§

fn delta_neutrality(&self) -> Result<DeltaInfo, GreeksError>

Calculates the net delta of the strategy and provides detailed information. Read more
Source§

fn is_delta_neutral(&self) -> bool

Checks if the strategy is delta neutral within the specified threshold. Read more
Source§

fn get_atm_strike(&self) -> Result<Positive, StrategyError>

get_atm_strike Read more
Source§

fn generate_delta_adjustments( &self, net_delta: Decimal, option_delta_per_contract: Decimal, option: &Options, ) -> Result<DeltaAdjustment, GreeksError>

Generates delta adjustments based on the given net delta and option delta per contract. Read more
Source§

fn delta_adjustments(&self) -> Result<Vec<DeltaAdjustment>, GreeksError>

Calculates required position adjustments to maintain delta neutrality Read more
Source§

fn apply_delta_adjustments( &mut self, action: Option<Action>, ) -> Result<(), StrategyError>

Apply Delta Adjustments Read more
Source§

fn apply_single_adjustment( &mut self, adjustment: &DeltaAdjustment, ) -> Result<(), StrategyError>

Apply Single Adjustment Read more
Source§

fn adjust_option_position( &mut self, quantity: Decimal, strike: &Positive, option_type: &OptionStyle, side: &Side, ) -> Result<(), StrategyError>

Adjust Option Position Read more
Source§

fn trade_from_delta_adjustment( &mut self, action: Action, ) -> Result<Vec<Trade>, StrategyError>

Generates a Trade object based on the given delta adjustment action. Read more
Source§

fn portfolio_greeks(&self) -> Result<PortfolioGreeks, GreeksError>

Calculates portfolio-level Greeks for the strategy. Read more
Source§

fn optimized_adjustment_plan( &self, config: AdjustmentConfig, target: AdjustmentTarget, ) -> Result<AdjustmentPlan, StrategyError>

Generates an optimized adjustment plan to achieve target Greeks. Read more
Source§

fn optimized_adjustment_plan_with_chain( &self, chain: &OptionChain, config: AdjustmentConfig, target: AdjustmentTarget, ) -> Result<AdjustmentPlan, StrategyError>

Generates an optimized adjustment plan using an option chain for new legs. Read more
Source§

fn meets_greek_targets( &self, target: &AdjustmentTarget, tolerance: Decimal, ) -> bool

Checks if the strategy meets the specified Greek targets. Read more
Source§

fn delta_gap(&self, target_delta: Decimal) -> Result<Decimal, GreeksError>

Returns the delta gap from a target value. Read more
Source§

impl<'de> Deserialize<'de> for CustomStrategy

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 Graph for CustomStrategy

Source§

fn graph_data(&self) -> GraphData

Return the raw data ready for plotting.
Source§

fn graph_config(&self) -> GraphConfig

Optional per‑object configuration overrides.
Source§

impl Greeks for CustomStrategy

Source§

fn get_options(&self) -> Result<Vec<&Options>, GreeksError>

Returns a vector of references to the option contracts for which Greeks will be calculated. Read more
Source§

fn greeks(&self) -> Result<Greek, GreeksError>

Calculates and returns all Greeks as a single Greek struct. Read more
Source§

fn delta(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate delta value for all options. Read more
Source§

fn gamma(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate gamma value for all options. Read more
Source§

fn theta(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate theta value for all options. Read more
Source§

fn vega(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate vega value for all options. Read more
Source§

fn rho(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate rho value for all options. Read more
Source§

fn rho_d(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate rho_d value for all options. Read more
Source§

fn alpha(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate alpha value for all options. Read more
Source§

fn vanna(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate vanna value for all options. Read more
Source§

fn vomma(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate vomma value for all options. Read more
Source§

fn veta(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate veta value for all options. Read more
Source§

fn charm(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate charm value for all options. Read more
Source§

fn color(&self) -> Result<Decimal, GreeksError>

Calculates the aggregate color value for all options. Read more
Source§

impl Optimizable for CustomStrategy

Source§

type Strategy = CustomStrategy

The type of strategy associated with this optimization.
Source§

fn find_optimal( &mut self, option_chain: &OptionChain, side: FindOptimalSide, criteria: OptimizationCriteria, )

Finds the optimal strategy based on the given criteria. The default implementation is a safe no-op: it emits a warning and leaves self unchanged. Specific strategies should override this method to provide their own optimization logic. Read more
Source§

fn get_best_ratio(&mut self, option_chain: &OptionChain, side: FindOptimalSide)

Finds the best ratio-based strategy within the given OptionChain. Read more
Source§

fn get_best_area(&mut self, option_chain: &OptionChain, side: FindOptimalSide)

Finds the best area-based strategy within the given OptionChain. Read more
Source§

fn filter_combinations<'a>( &'a self, _option_chain: &'a OptionChain, _side: FindOptimalSide, ) -> impl Iterator<Item = OptionDataGroup<'a>>

Filters and generates combinations of options data from the given OptionChain. Read more
Source§

fn is_valid_optimal_option( &self, option: &OptionData, side: &FindOptimalSide, ) -> bool

Checks if a long option is valid based on the given criteria. Read more
Source§

fn are_valid_legs(&self, legs: &StrategyLegs<'_>) -> bool

Checks if the prices in the given StrategyLegs are valid. Assumes the strategy consists of one long call and one short call by default. Read more
Source§

fn create_strategy( &self, _chain: &OptionChain, _legs: &StrategyLegs<'_>, ) -> Result<Self::Strategy, StrategyError>

Creates a new strategy from the given OptionChain and StrategyLegs. Read more
Source§

impl PnLCalculator for CustomStrategy

Source§

fn calculate_pnl( &self, market_price: &Positive, expiration_date: ExpirationDate, implied_volatility: &Positive, ) -> Result<PnL, PricingError>

Calculates the current PnL based on market conditions. Read more
Source§

fn calculate_pnl_at_expiration( &self, underlying_price: &Positive, ) -> Result<PnL, PricingError>

Calculates the PnL at the expiration of the instrument. Read more
Source§

fn adjustments_pnl( &self, adjustment: &DeltaAdjustment, ) -> Result<PnL, PricingError>

Calculates the Profit and Loss (PnL) for a single delta adjustment applied to a trading strategy. Read more
Source§

fn diff_position_pnl(&self, _position: &Position) -> Result<PnL, PricingError>

Calculates the profit and loss (PnL) for a given trading position. Read more
Source§

impl Positionable for CustomStrategy

Source§

fn add_position(&mut self, position: &Position) -> Result<(), PositionError>

Adds a position to the strategy. Read more
Source§

fn get_positions(&self) -> Result<Vec<&Position>, PositionError>

Retrieves all positions held by the strategy. Read more
Source§

fn get_position( &mut self, option_style: &OptionStyle, side: &Side, strike: &Positive, ) -> Result<Vec<&mut Position>, PositionError>

Retrieves a specific position based on option style, side, and strike. Read more
Source§

fn get_position_unique( &mut self, option_style: &OptionStyle, side: &Side, ) -> Result<&mut Position, PositionError>

Retrieves a unique position based on the given option style and side. Read more
Source§

fn get_option_unique( &mut self, option_style: &OptionStyle, side: &Side, ) -> Result<&mut Options, PositionError>

Retrieves a unique option based on the given style and side. Read more
Source§

fn modify_position(&mut self, position: &Position) -> Result<(), PositionError>

Modifies an existing position. Read more
Source§

fn replace_position(&mut self, position: &Position) -> Result<(), PositionError>

Attempts to replace the current position with a new position. Read more
Source§

fn valid_premium_for_shorts(&self, min_premium: &Positive) -> bool

Checks if all short positions have a net premium received that meets or exceeds a specified minimum. Read more
Source§

impl ProbabilityAnalysis for CustomStrategy

Source§

fn get_profit_ranges(&self) -> Result<Vec<ProfitLossRange>, ProbabilityError>

Get the price ranges that would result in a profit Read more
Source§

fn get_loss_ranges(&self) -> Result<Vec<ProfitLossRange>, ProbabilityError>

Get Profit/Loss Ranges Read more
Source§

fn analyze_probabilities( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<StrategyProbabilityAnalysis, ProbabilityError>

Calculate probability analysis for a strategy Read more
Source§

fn expected_value( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<Positive, ProbabilityError>

This function calculates the expected value of an option strategy based on an underlying price, volatility adjustments, and price trends. Read more
Source§

fn probability_of_profit( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<Positive, ProbabilityError>

Calculate probability of profit Read more
Source§

fn probability_of_loss( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<Positive, ProbabilityError>

Calculate probability of loss Read more
Source§

fn calculate_extreme_probabilities( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<(Positive, Positive), ProbabilityError>

Calculate extreme probabilities (max profit and max loss) Read more
Source§

impl Profit for CustomStrategy

Source§

fn calculate_profit_at(&self, price: &Positive) -> Result<Decimal, PricingError>

Calculates the profit at a specified price. Read more
Source§

fn get_point_at_price( &self, _price: &Positive, ) -> Result<(Decimal, Decimal), PricingError>

Creates a chart point representation of the profit at the given price. Read more
Source§

impl Serialize for CustomStrategy

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 Strategable for CustomStrategy

Source§

fn info(&self) -> Result<StrategyBasics, StrategyError>

Returns basic information about the strategy, such as its name, type, and description. Read more
Source§

fn type_name(&self) -> StrategyType

Returns the type of the strategy. Read more
Source§

fn name(&self) -> String

Returns the name of the strategy. Read more
Source§

impl Strategies for CustomStrategy

Source§

fn get_volume(&mut self) -> Result<Positive, StrategyError>

Retrieves the current volume of the strategy as sum of quantities in their positions Read more
Source§

fn get_max_profit(&self) -> Result<Positive, StrategyError>

Calculates the maximum possible profit for the strategy. The default implementation returns an error indicating that the operation is not supported. Read more
Source§

fn get_max_loss(&self) -> Result<Positive, StrategyError>

Calculates the maximum possible loss for the strategy. The default implementation returns an error indicating that the operation is not supported. Read more
Source§

fn get_profit_area(&self) -> Result<Decimal, StrategyError>

Calculates the profit area for the strategy. The default implementation returns an error indicating that the operation is not supported. Read more
Source§

fn get_profit_ratio(&self) -> Result<Decimal, StrategyError>

Calculates the profit ratio for the strategy. The default implementation returns an error indicating that the operation is not supported. Read more
Source§

fn get_best_range_to_show( &self, step: Positive, ) -> Result<Vec<Positive>, StrategyError>

Generates a vector of prices within the display range, using a specified step. Read more
Source§

fn roll_in( &mut self, _position: &Position, ) -> Result<HashMap<Action, Trade>, StrategyError>

Attempts to execute the roll-in functionality for the strategy. Read more
Source§

fn roll_out( &mut self, _position: &Position, ) -> Result<HashMap<Action, Trade>, StrategyError>

Executes the roll-out strategy for the provided position. Read more
Source§

fn get_max_profit_mut(&mut self) -> Result<Positive, StrategyError>

Calculates the maximum possible profit for the strategy, potentially using an iterative approach. Defaults to calling max_profit. Read more
Source§

fn get_max_loss_mut(&mut self) -> Result<Positive, StrategyError>

Calculates the maximum possible loss for the strategy, potentially using an iterative approach. Defaults to calling max_loss. Read more
Source§

fn get_total_cost(&self) -> Result<Positive, PositionError>

Calculates the total cost of the strategy, which is the sum of the absolute cost of all positions. Read more
Source§

fn get_net_cost(&self) -> Result<Decimal, PositionError>

Calculates the net cost of the strategy, which is the sum of the costs of all positions, considering premiums paid and received. Read more
Source§

fn get_net_premium_received(&self) -> Result<Positive, StrategyError>

Calculates the net premium received for the strategy. This is the total premium received from short positions minus the total premium paid for long positions. If the result is negative, it returns zero. Read more
Source§

fn get_fees(&self) -> Result<Positive, StrategyError>

Calculates the total fees for the strategy by summing the fees of all positions. Read more
Source§

fn get_range_to_show(&self) -> Result<(Positive, Positive), StrategyError>

Determines the price range to display for the strategy’s profit/loss graph. This range is calculated based on the break-even points, the underlying price, and the maximum and minimum strike prices. The range is expanded by applying STRIKE_PRICE_LOWER_BOUND_MULTIPLIER and STRIKE_PRICE_UPPER_BOUND_MULTIPLIER to the minimum and maximum prices respectively. Read more
Source§

fn get_max_min_strikes(&self) -> Result<(Positive, Positive), StrategyError>

Returns the minimum and maximum strike prices from the positions in the strategy. Considers underlying price when applicable, ensuring the returned range includes it. Read more
Source§

fn get_range_of_profit(&self) -> Result<Positive, StrategyError>

Calculates the range of prices where the strategy is profitable, based on the break-even points. Read more
Source§

impl StrategyConstructor for CustomStrategy

Source§

fn get_strategy(vec_options: &[Position]) -> Result<Self, StrategyError>

Attempts to construct a strategy from a vector of option positions. Read more
Source§

impl ToSchema for CustomStrategy

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 Validable for CustomStrategy

Source§

fn validate(&self) -> bool

Validates the strategy. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

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<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, 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