pub enum PortfolioConstraint {
LongOnly,
LongShort,
}Expand description
Directional constraint applied to portfolio weights during projection.
Variants§
LongOnly
Long-only weights (non-negative lower bound of 0.0).
LongShort
Long-short weights (unbounded negative lower bound of -inf).
Implementations§
Source§impl PortfolioConstraint
impl PortfolioConstraint
pub const fn is_long_only(self) -> bool
pub const fn is_long_short(self) -> bool
Trait Implementations§
Source§impl Clone for PortfolioConstraint
impl Clone for PortfolioConstraint
impl Copy for PortfolioConstraint
Source§impl Debug for PortfolioConstraint
impl Debug for PortfolioConstraint
Source§impl Default for PortfolioConstraint
impl Default for PortfolioConstraint
Source§impl<'de> Deserialize<'de> for PortfolioConstraint
impl<'de> Deserialize<'de> for PortfolioConstraint
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PortfolioConstraint
Source§impl From<PortfolioConstraint> for bool
impl From<PortfolioConstraint> for bool
Source§fn from(constraint: PortfolioConstraint) -> Self
fn from(constraint: PortfolioConstraint) -> Self
Converts to this type from the input type.
Source§impl From<bool> for PortfolioConstraint
impl From<bool> for PortfolioConstraint
Source§impl PartialEq for PortfolioConstraint
impl PartialEq for PortfolioConstraint
Source§impl Serialize for PortfolioConstraint
impl Serialize for PortfolioConstraint
impl StructuralPartialEq for PortfolioConstraint
Auto Trait Implementations§
impl Forget for PortfolioConstraint
impl Freeze for PortfolioConstraint
impl RefUnwindSafe for PortfolioConstraint
impl Send for PortfolioConstraint
impl Sync for PortfolioConstraint
impl Unpin for PortfolioConstraint
impl UnsafeUnpin for PortfolioConstraint
impl UnwindSafe for PortfolioConstraint
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
Mutably borrows from an owned value. Read more
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>,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.