Struct plutus_ledger_api::v1::interval::PlutusInterval
source · pub struct PlutusInterval<T>where
T: FeatureTraits,{
pub from: LowerBound<T>,
pub to: UpperBound<T>,
}
Expand description
An interval of T
s.
The interval may be either closed or open at either end, meaning that the endpoints may or may not be included in the interval.
The interval can also be unbounded on either side.
The ‘Eq’ instance gives equality of the intervals, not structural equality. There is no ‘Ord’ instance, but ‘contains’ gives a partial order.
Note that some of the functions on Interval
rely on Enum
in order to
handle non-inclusive endpoints. For this reason, it may not be safe to
use Interval
s with non-inclusive endpoints on types whose Enum
instances have partial methods.
Fields§
§from: LowerBound<T>
§to: UpperBound<T>
Trait Implementations§
source§impl<T> Clone for PlutusInterval<T>where
T: FeatureTraits + Clone,
impl<T> Clone for PlutusInterval<T>where
T: FeatureTraits + Clone,
source§fn clone(&self) -> PlutusInterval<T>
fn clone(&self) -> PlutusInterval<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for PlutusInterval<T>where
T: FeatureTraits + Debug,
impl<T> Debug for PlutusInterval<T>where
T: FeatureTraits + Debug,
source§impl<T> From<Interval<T>> for PlutusInterval<T>where
T: FeatureTraits,
impl<T> From<Interval<T>> for PlutusInterval<T>where
T: FeatureTraits,
source§impl<T> Hash for PlutusInterval<T>where
T: FeatureTraits + Hash,
impl<T> Hash for PlutusInterval<T>where
T: FeatureTraits + Hash,
source§impl<T> IsPlutusData for PlutusInterval<T>where
T: FeatureTraits + IsPlutusData,
impl<T> IsPlutusData for PlutusInterval<T>where
T: FeatureTraits + IsPlutusData,
fn to_plutus_data(&self) -> PlutusData
fn from_plutus_data(data: &PlutusData) -> Result<Self, PlutusDataError>
source§impl<T> Ord for PlutusInterval<T>where
T: FeatureTraits + Ord,
impl<T> Ord for PlutusInterval<T>where
T: FeatureTraits + Ord,
source§fn cmp(&self, other: &PlutusInterval<T>) -> Ordering
fn cmp(&self, other: &PlutusInterval<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T> PartialEq for PlutusInterval<T>where
T: FeatureTraits + PartialEq,
impl<T> PartialEq for PlutusInterval<T>where
T: FeatureTraits + PartialEq,
source§fn eq(&self, other: &PlutusInterval<T>) -> bool
fn eq(&self, other: &PlutusInterval<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T> PartialOrd for PlutusInterval<T>where
T: FeatureTraits + PartialOrd,
impl<T> PartialOrd for PlutusInterval<T>where
T: FeatureTraits + PartialOrd,
source§fn partial_cmp(&self, other: &PlutusInterval<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &PlutusInterval<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T> TryFrom<PlutusInterval<T>> for Interval<T>where
T: FeatureTraits + PartialOrd,
impl<T> TryFrom<PlutusInterval<T>> for Interval<T>where
T: FeatureTraits + PartialOrd,
§type Error = TryFromPlutusIntervalError
type Error = TryFromPlutusIntervalError
The type returned in the event of a conversion error.
impl<T> Eq for PlutusInterval<T>where
T: FeatureTraits + Eq,
impl<T> StructuralPartialEq for PlutusInterval<T>where
T: FeatureTraits,
Auto Trait Implementations§
impl<T> Freeze for PlutusInterval<T>where
T: Freeze,
impl<T> RefUnwindSafe for PlutusInterval<T>where
T: RefUnwindSafe,
impl<T> Send for PlutusInterval<T>where
T: Send,
impl<T> Sync for PlutusInterval<T>where
T: Sync,
impl<T> Unpin for PlutusInterval<T>where
T: Unpin,
impl<T> UnwindSafe for PlutusInterval<T>where
T: UnwindSafe,
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