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: StringThe name of the custom strategy.
symbol: StringThe ticker symbol of the underlying asset.
kind: StrategyTypeThe type of strategy, typically set to StrategyType::Custom.
description: StringA 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: PositiveThe current price of the underlying asset.
Implementations§
Source§impl CustomStrategy
impl CustomStrategy
Sourcepub 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>
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 strategysymbol- The ticker symbol of the underlying assetdescription- A detailed description of the strategy’s purpose and characteristicsunderlying_price- The current price of the underlying assetpositions- A collection of option positions that compose the strategyepsilon- Tolerance value used in numerical calculations for finding critical pointsmax_iterations- Maximum number of iterations allowed in numerical algorithmsstep_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
impl BasicAble for CustomStrategy
Source§fn get_title(&self) -> String
fn get_title(&self) -> String
Source§fn get_option_basic_type(&self) -> HashSet<OptionBasicType<'_>>
fn get_option_basic_type(&self) -> HashSet<OptionBasicType<'_>>
Source§fn get_implied_volatility(&self) -> HashMap<OptionBasicType<'_>, &Positive>
fn get_implied_volatility(&self) -> HashMap<OptionBasicType<'_>, &Positive>
Source§fn get_quantity(&self) -> HashMap<OptionBasicType<'_>, &Positive>
fn get_quantity(&self) -> HashMap<OptionBasicType<'_>, &Positive>
Source§fn one_option(&self) -> &Options
fn one_option(&self) -> &Options
Options value. Read moreSource§fn one_option_mut(&mut self) -> &mut Options
fn one_option_mut(&mut self) -> &mut Options
Options value. Read moreSource§fn set_expiration_date(
&mut self,
expiration_date: ExpirationDate,
) -> Result<(), StrategyError>
fn set_expiration_date( &mut self, expiration_date: ExpirationDate, ) -> Result<(), StrategyError>
Source§fn set_underlying_price(
&mut self,
price: &Positive,
) -> Result<(), StrategyError>
fn set_underlying_price( &mut self, price: &Positive, ) -> Result<(), StrategyError>
Source§fn set_implied_volatility(
&mut self,
volatility: &Positive,
) -> Result<(), StrategyError>
fn set_implied_volatility( &mut self, volatility: &Positive, ) -> Result<(), StrategyError>
Source§fn get_symbol(&self) -> &str
fn get_symbol(&self) -> &str
get_symbol
method of the one_option object. Read moreSource§fn get_strike(&self) -> HashMap<OptionBasicType<'_>, &Positive>
fn get_strike(&self) -> HashMap<OptionBasicType<'_>, &Positive>
Source§fn get_strikes(&self) -> Vec<&Positive>
fn get_strikes(&self) -> Vec<&Positive>
Source§fn get_type(&self) -> &OptionType
fn get_type(&self) -> &OptionType
Source§fn get_style(&self) -> HashMap<OptionBasicType<'_>, &OptionStyle>
fn get_style(&self) -> HashMap<OptionBasicType<'_>, &OptionStyle>
Source§fn get_expiration(&self) -> HashMap<OptionBasicType<'_>, &ExpirationDate>
fn get_expiration(&self) -> HashMap<OptionBasicType<'_>, &ExpirationDate>
Source§fn get_underlying_price(&self) -> &Positive
fn get_underlying_price(&self) -> &Positive
Source§fn get_risk_free_rate(&self) -> HashMap<OptionBasicType<'_>, &Decimal>
fn get_risk_free_rate(&self) -> HashMap<OptionBasicType<'_>, &Decimal>
Source§fn get_dividend_yield(&self) -> HashMap<OptionBasicType<'_>, &Positive>
fn get_dividend_yield(&self) -> HashMap<OptionBasicType<'_>, &Positive>
Source§impl BreakEvenable for CustomStrategy
impl BreakEvenable for CustomStrategy
Source§fn get_break_even_points(&self) -> Result<&Vec<Positive>, StrategyError>
fn get_break_even_points(&self) -> Result<&Vec<Positive>, StrategyError>
Source§fn update_break_even_points(&mut self) -> Result<(), StrategyError>
fn update_break_even_points(&mut self) -> Result<(), StrategyError>
Source§impl Clone for CustomStrategy
impl Clone for CustomStrategy
Source§fn clone(&self) -> CustomStrategy
fn clone(&self) -> CustomStrategy
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 CustomStrategy
impl ComposeSchema for CustomStrategy
Source§impl Debug for CustomStrategy
impl Debug for CustomStrategy
Source§impl DeltaNeutrality for CustomStrategy
impl DeltaNeutrality for CustomStrategy
Source§fn delta_neutrality(&self) -> Result<DeltaInfo, GreeksError>
fn delta_neutrality(&self) -> Result<DeltaInfo, GreeksError>
Source§fn is_delta_neutral(&self) -> bool
fn is_delta_neutral(&self) -> bool
Source§fn get_atm_strike(&self) -> Result<Positive, StrategyError>
fn get_atm_strike(&self) -> Result<Positive, StrategyError>
Source§fn generate_delta_adjustments(
&self,
net_delta: Decimal,
option_delta_per_contract: Decimal,
option: &Options,
) -> Result<DeltaAdjustment, GreeksError>
fn generate_delta_adjustments( &self, net_delta: Decimal, option_delta_per_contract: Decimal, option: &Options, ) -> Result<DeltaAdjustment, GreeksError>
Source§fn delta_adjustments(&self) -> Result<Vec<DeltaAdjustment>, GreeksError>
fn delta_adjustments(&self) -> Result<Vec<DeltaAdjustment>, GreeksError>
Source§fn apply_delta_adjustments(
&mut self,
action: Option<Action>,
) -> Result<(), StrategyError>
fn apply_delta_adjustments( &mut self, action: Option<Action>, ) -> Result<(), StrategyError>
Source§fn apply_single_adjustment(
&mut self,
adjustment: &DeltaAdjustment,
) -> Result<(), StrategyError>
fn apply_single_adjustment( &mut self, adjustment: &DeltaAdjustment, ) -> Result<(), StrategyError>
Source§fn adjust_option_position(
&mut self,
quantity: Decimal,
strike: &Positive,
option_type: &OptionStyle,
side: &Side,
) -> Result<(), StrategyError>
fn adjust_option_position( &mut self, quantity: Decimal, strike: &Positive, option_type: &OptionStyle, side: &Side, ) -> Result<(), StrategyError>
Source§fn trade_from_delta_adjustment(
&mut self,
action: Action,
) -> Result<Vec<Trade>, StrategyError>
fn trade_from_delta_adjustment( &mut self, action: Action, ) -> Result<Vec<Trade>, StrategyError>
Trade object based on the given delta adjustment action. Read moreSource§fn portfolio_greeks(&self) -> Result<PortfolioGreeks, GreeksError>
fn portfolio_greeks(&self) -> Result<PortfolioGreeks, GreeksError>
Source§fn optimized_adjustment_plan(
&self,
config: AdjustmentConfig,
target: AdjustmentTarget,
) -> Result<AdjustmentPlan, StrategyError>
fn optimized_adjustment_plan( &self, config: AdjustmentConfig, target: AdjustmentTarget, ) -> Result<AdjustmentPlan, StrategyError>
Source§fn optimized_adjustment_plan_with_chain(
&self,
chain: &OptionChain,
config: AdjustmentConfig,
target: AdjustmentTarget,
) -> Result<AdjustmentPlan, StrategyError>
fn optimized_adjustment_plan_with_chain( &self, chain: &OptionChain, config: AdjustmentConfig, target: AdjustmentTarget, ) -> Result<AdjustmentPlan, StrategyError>
Source§fn meets_greek_targets(
&self,
target: &AdjustmentTarget,
tolerance: Decimal,
) -> bool
fn meets_greek_targets( &self, target: &AdjustmentTarget, tolerance: Decimal, ) -> bool
Source§impl<'de> Deserialize<'de> for CustomStrategy
impl<'de> Deserialize<'de> for CustomStrategy
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 Graph for CustomStrategy
impl Graph for CustomStrategy
Source§fn graph_data(&self) -> GraphData
fn graph_data(&self) -> GraphData
Source§fn graph_config(&self) -> GraphConfig
fn graph_config(&self) -> GraphConfig
Source§impl Greeks for CustomStrategy
impl Greeks for CustomStrategy
Source§fn get_options(&self) -> Result<Vec<&Options>, GreeksError>
fn get_options(&self) -> Result<Vec<&Options>, GreeksError>
Source§fn greeks(&self) -> Result<Greek, GreeksError>
fn greeks(&self) -> Result<Greek, GreeksError>
Greek struct. Read moreSource§fn delta(&self) -> Result<Decimal, GreeksError>
fn delta(&self) -> Result<Decimal, GreeksError>
Source§fn gamma(&self) -> Result<Decimal, GreeksError>
fn gamma(&self) -> Result<Decimal, GreeksError>
Source§fn theta(&self) -> Result<Decimal, GreeksError>
fn theta(&self) -> Result<Decimal, GreeksError>
Source§fn vega(&self) -> Result<Decimal, GreeksError>
fn vega(&self) -> Result<Decimal, GreeksError>
Source§fn rho(&self) -> Result<Decimal, GreeksError>
fn rho(&self) -> Result<Decimal, GreeksError>
Source§fn rho_d(&self) -> Result<Decimal, GreeksError>
fn rho_d(&self) -> Result<Decimal, GreeksError>
Source§fn alpha(&self) -> Result<Decimal, GreeksError>
fn alpha(&self) -> Result<Decimal, GreeksError>
Source§fn vanna(&self) -> Result<Decimal, GreeksError>
fn vanna(&self) -> Result<Decimal, GreeksError>
Source§fn vomma(&self) -> Result<Decimal, GreeksError>
fn vomma(&self) -> Result<Decimal, GreeksError>
Source§fn veta(&self) -> Result<Decimal, GreeksError>
fn veta(&self) -> Result<Decimal, GreeksError>
Source§impl Optimizable for CustomStrategy
impl Optimizable for CustomStrategy
Source§type Strategy = CustomStrategy
type Strategy = CustomStrategy
Source§fn find_optimal(
&mut self,
option_chain: &OptionChain,
side: FindOptimalSide,
criteria: OptimizationCriteria,
)
fn find_optimal( &mut self, option_chain: &OptionChain, side: FindOptimalSide, criteria: OptimizationCriteria, )
self unchanged. Specific strategies should override this
method to provide their own optimization logic. Read moreSource§fn get_best_ratio(&mut self, option_chain: &OptionChain, side: FindOptimalSide)
fn get_best_ratio(&mut self, option_chain: &OptionChain, side: FindOptimalSide)
OptionChain. Read moreSource§fn get_best_area(&mut self, option_chain: &OptionChain, side: FindOptimalSide)
fn get_best_area(&mut self, option_chain: &OptionChain, side: FindOptimalSide)
OptionChain. Read moreSource§fn filter_combinations<'a>(
&'a self,
_option_chain: &'a OptionChain,
_side: FindOptimalSide,
) -> impl Iterator<Item = OptionDataGroup<'a>>
fn filter_combinations<'a>( &'a self, _option_chain: &'a OptionChain, _side: FindOptimalSide, ) -> impl Iterator<Item = OptionDataGroup<'a>>
OptionChain. Read moreSource§fn is_valid_optimal_option(
&self,
option: &OptionData,
side: &FindOptimalSide,
) -> bool
fn is_valid_optimal_option( &self, option: &OptionData, side: &FindOptimalSide, ) -> bool
Source§fn are_valid_legs(&self, legs: &StrategyLegs<'_>) -> bool
fn are_valid_legs(&self, legs: &StrategyLegs<'_>) -> bool
StrategyLegs are valid.
Assumes the strategy consists of one long call and one short call by default. Read moreSource§fn create_strategy(
&self,
_chain: &OptionChain,
_legs: &StrategyLegs<'_>,
) -> Result<Self::Strategy, StrategyError>
fn create_strategy( &self, _chain: &OptionChain, _legs: &StrategyLegs<'_>, ) -> Result<Self::Strategy, StrategyError>
Source§impl PnLCalculator for CustomStrategy
impl PnLCalculator for CustomStrategy
Source§fn calculate_pnl(
&self,
market_price: &Positive,
expiration_date: ExpirationDate,
implied_volatility: &Positive,
) -> Result<PnL, PricingError>
fn calculate_pnl( &self, market_price: &Positive, expiration_date: ExpirationDate, implied_volatility: &Positive, ) -> Result<PnL, PricingError>
Source§fn calculate_pnl_at_expiration(
&self,
underlying_price: &Positive,
) -> Result<PnL, PricingError>
fn calculate_pnl_at_expiration( &self, underlying_price: &Positive, ) -> Result<PnL, PricingError>
Source§fn adjustments_pnl(
&self,
adjustment: &DeltaAdjustment,
) -> Result<PnL, PricingError>
fn adjustments_pnl( &self, adjustment: &DeltaAdjustment, ) -> Result<PnL, PricingError>
Source§fn diff_position_pnl(&self, _position: &Position) -> Result<PnL, PricingError>
fn diff_position_pnl(&self, _position: &Position) -> Result<PnL, PricingError>
Source§impl Positionable for CustomStrategy
impl Positionable for CustomStrategy
Source§fn add_position(&mut self, position: &Position) -> Result<(), PositionError>
fn add_position(&mut self, position: &Position) -> Result<(), PositionError>
Source§fn get_positions(&self) -> Result<Vec<&Position>, PositionError>
fn get_positions(&self) -> Result<Vec<&Position>, PositionError>
Source§fn get_position(
&mut self,
option_style: &OptionStyle,
side: &Side,
strike: &Positive,
) -> Result<Vec<&mut Position>, PositionError>
fn get_position( &mut self, option_style: &OptionStyle, side: &Side, strike: &Positive, ) -> Result<Vec<&mut Position>, PositionError>
Source§fn get_position_unique(
&mut self,
option_style: &OptionStyle,
side: &Side,
) -> Result<&mut Position, PositionError>
fn get_position_unique( &mut self, option_style: &OptionStyle, side: &Side, ) -> Result<&mut Position, PositionError>
Source§fn get_option_unique(
&mut self,
option_style: &OptionStyle,
side: &Side,
) -> Result<&mut Options, PositionError>
fn get_option_unique( &mut self, option_style: &OptionStyle, side: &Side, ) -> Result<&mut Options, PositionError>
Source§fn modify_position(&mut self, position: &Position) -> Result<(), PositionError>
fn modify_position(&mut self, position: &Position) -> Result<(), PositionError>
Source§fn replace_position(&mut self, position: &Position) -> Result<(), PositionError>
fn replace_position(&mut self, position: &Position) -> Result<(), PositionError>
Source§impl ProbabilityAnalysis for CustomStrategy
impl ProbabilityAnalysis for CustomStrategy
Source§fn get_profit_ranges(&self) -> Result<Vec<ProfitLossRange>, ProbabilityError>
fn get_profit_ranges(&self) -> Result<Vec<ProfitLossRange>, ProbabilityError>
Source§fn get_loss_ranges(&self) -> Result<Vec<ProfitLossRange>, ProbabilityError>
fn get_loss_ranges(&self) -> Result<Vec<ProfitLossRange>, ProbabilityError>
Source§fn analyze_probabilities(
&self,
volatility_adj: Option<VolatilityAdjustment>,
trend: Option<PriceTrend>,
) -> Result<StrategyProbabilityAnalysis, ProbabilityError>
fn analyze_probabilities( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<StrategyProbabilityAnalysis, ProbabilityError>
Source§fn expected_value(
&self,
volatility_adj: Option<VolatilityAdjustment>,
trend: Option<PriceTrend>,
) -> Result<Positive, ProbabilityError>
fn expected_value( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<Positive, ProbabilityError>
Source§fn probability_of_profit(
&self,
volatility_adj: Option<VolatilityAdjustment>,
trend: Option<PriceTrend>,
) -> Result<Positive, ProbabilityError>
fn probability_of_profit( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<Positive, ProbabilityError>
Source§fn probability_of_loss(
&self,
volatility_adj: Option<VolatilityAdjustment>,
trend: Option<PriceTrend>,
) -> Result<Positive, ProbabilityError>
fn probability_of_loss( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<Positive, ProbabilityError>
Source§fn calculate_extreme_probabilities(
&self,
volatility_adj: Option<VolatilityAdjustment>,
trend: Option<PriceTrend>,
) -> Result<(Positive, Positive), ProbabilityError>
fn calculate_extreme_probabilities( &self, volatility_adj: Option<VolatilityAdjustment>, trend: Option<PriceTrend>, ) -> Result<(Positive, Positive), ProbabilityError>
Source§impl Profit for CustomStrategy
impl Profit for CustomStrategy
Source§fn calculate_profit_at(&self, price: &Positive) -> Result<Decimal, PricingError>
fn calculate_profit_at(&self, price: &Positive) -> Result<Decimal, PricingError>
Source§fn get_point_at_price(
&self,
_price: &Positive,
) -> Result<(Decimal, Decimal), PricingError>
fn get_point_at_price( &self, _price: &Positive, ) -> Result<(Decimal, Decimal), PricingError>
Source§impl Serialize for CustomStrategy
impl Serialize for CustomStrategy
Source§impl Strategable for CustomStrategy
impl Strategable for CustomStrategy
Source§fn info(&self) -> Result<StrategyBasics, StrategyError>
fn info(&self) -> Result<StrategyBasics, StrategyError>
Source§fn type_name(&self) -> StrategyType
fn type_name(&self) -> StrategyType
Source§impl Strategies for CustomStrategy
impl Strategies for CustomStrategy
Source§fn get_volume(&mut self) -> Result<Positive, StrategyError>
fn get_volume(&mut self) -> Result<Positive, StrategyError>
Source§fn get_max_profit(&self) -> Result<Positive, StrategyError>
fn get_max_profit(&self) -> Result<Positive, StrategyError>
Source§fn get_max_loss(&self) -> Result<Positive, StrategyError>
fn get_max_loss(&self) -> Result<Positive, StrategyError>
Source§fn get_profit_area(&self) -> Result<Decimal, StrategyError>
fn get_profit_area(&self) -> Result<Decimal, StrategyError>
Source§fn get_profit_ratio(&self) -> Result<Decimal, StrategyError>
fn get_profit_ratio(&self) -> Result<Decimal, StrategyError>
Source§fn get_best_range_to_show(
&self,
step: Positive,
) -> Result<Vec<Positive>, StrategyError>
fn get_best_range_to_show( &self, step: Positive, ) -> Result<Vec<Positive>, StrategyError>
Source§fn roll_in(
&mut self,
_position: &Position,
) -> Result<HashMap<Action, Trade>, StrategyError>
fn roll_in( &mut self, _position: &Position, ) -> Result<HashMap<Action, Trade>, StrategyError>
Source§fn roll_out(
&mut self,
_position: &Position,
) -> Result<HashMap<Action, Trade>, StrategyError>
fn roll_out( &mut self, _position: &Position, ) -> Result<HashMap<Action, Trade>, StrategyError>
Source§fn get_max_profit_mut(&mut self) -> Result<Positive, StrategyError>
fn get_max_profit_mut(&mut self) -> Result<Positive, StrategyError>
max_profit. Read moreSource§fn get_max_loss_mut(&mut self) -> Result<Positive, StrategyError>
fn get_max_loss_mut(&mut self) -> Result<Positive, StrategyError>
max_loss. Read moreSource§fn get_total_cost(&self) -> Result<Positive, PositionError>
fn get_total_cost(&self) -> Result<Positive, PositionError>
Source§fn get_net_cost(&self) -> Result<Decimal, PositionError>
fn get_net_cost(&self) -> Result<Decimal, PositionError>
Source§fn get_fees(&self) -> Result<Positive, StrategyError>
fn get_fees(&self) -> Result<Positive, StrategyError>
Source§fn get_range_to_show(&self) -> Result<(Positive, Positive), StrategyError>
fn get_range_to_show(&self) -> Result<(Positive, Positive), StrategyError>
STRIKE_PRICE_LOWER_BOUND_MULTIPLIER and
STRIKE_PRICE_UPPER_BOUND_MULTIPLIER to the minimum and maximum prices respectively. Read moreSource§fn get_max_min_strikes(&self) -> Result<(Positive, Positive), StrategyError>
fn get_max_min_strikes(&self) -> Result<(Positive, Positive), StrategyError>
Source§fn get_range_of_profit(&self) -> Result<Positive, StrategyError>
fn get_range_of_profit(&self) -> Result<Positive, StrategyError>
Source§impl StrategyConstructor for CustomStrategy
impl StrategyConstructor for CustomStrategy
Source§fn get_strategy(vec_options: &[Position]) -> Result<Self, StrategyError>
fn get_strategy(vec_options: &[Position]) -> Result<Self, StrategyError>
Source§impl ToSchema for CustomStrategy
impl ToSchema for CustomStrategy
Auto Trait Implementations§
impl Freeze for CustomStrategy
impl RefUnwindSafe for CustomStrategy
impl Send for CustomStrategy
impl Sync for CustomStrategy
impl Unpin for CustomStrategy
impl UnsafeUnpin for CustomStrategy
impl UnwindSafe for CustomStrategy
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
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.