Trait Collection

Source
pub trait Collection:
    PartialEq
    + Debug
    + Clone {
    type Type;

    // Required methods
    fn is_contained_in(&self, container: &Self) -> bool;
    fn contains(&self, content: &Self::Type) -> bool;
    fn overlaps(&self, other: &Self) -> bool;
    fn is_left(&self, other: &Self) -> bool;
    fn is_over_or_left(&self, other: &Self) -> bool;
    fn is_over_or_right(&self, other: &Self) -> bool;
    fn is_right(&self, other: &Self) -> bool;
    fn is_adjacent(&self, other: &Self) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn is_contained_in(&self, container: &Self) -> bool

Returns whether self is contained in container.

§Arguments
  • container - The container to compare with.
§Returns
  • true if contained, false otherwise.
Source

fn contains(&self, content: &Self::Type) -> bool

Determines if the collection contains the specified item.

§Arguments
  • content - The item to check for containment within the collection.
§Returns
  • true if the collection contains the specified item, false otherwise.
Source

fn overlaps(&self, other: &Self) -> bool

Returns whether self overlaps other. That is, both share at least an element.

§Arguments
  • other - The object to compare with.
§Returns
  • true if overlaps, false otherwise.
Source

fn is_left(&self, other: &Self) -> bool

Returns whether self is strictly before other. That is, self ends before other starts.

§Arguments
  • other - The object to compare with.
§Returns
  • true if before, false otherwise.
Source

fn is_over_or_left(&self, other: &Self) -> bool

Returns whether self is before other allowing overlap. That is, self ends before other ends (or at the same time).

§Arguments
  • other - The object to compare with.
§Returns
  • true if before, false otherwise.
Source

fn is_over_or_right(&self, other: &Self) -> bool

Returns whether self is after other allowing overlap. That is, self starts after other starts (or at the same time).

§Arguments
  • other - The object to compare with.
§Returns
  • true if overlapping or after, false otherwise.
Source

fn is_right(&self, other: &Self) -> bool

Returns whether self is strictly after other. That is, self starts after other ends.

§Arguments
  • other - The object to compare with.
§Returns
  • true if after, false otherwise.
Source

fn is_adjacent(&self, other: &Self) -> bool

Returns whether self is adjacent to other. That is, self starts just after other ends.

§Arguments
  • other - The object to compare with.
§Returns
  • true if adjacent, false otherwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Collection for TBool

Source§

impl Collection for TFloat

Source§

impl Collection for TGeogPoint

Source§

impl Collection for TGeomPoint

Source§

impl Collection for TInt

Source§

impl Collection for TText

Source§

impl Collection for DateSpan

Source§

impl Collection for DateSpanSet

Source§

impl Collection for FloatSpan

Source§

impl Collection for FloatSpanSet

Source§

impl Collection for IntSpan

Source§

impl Collection for IntSpanSet

Source§

impl Collection for STBox

Source§

impl Collection for TBoolInstant

Source§

impl Collection for TBoolSequence

Source§

impl Collection for TBoolSequenceSet

Source§

impl Collection for TBox

Source§

impl Collection for TFloatInstant

Source§

impl Collection for TFloatSequence

Source§

impl Collection for TFloatSequenceSet

Source§

impl Collection for TGeogPointInstant

Source§

impl Collection for TGeogPointSequence

Source§

impl Collection for TGeogPointSequenceSet

Source§

impl Collection for TGeomPointInstant

Source§

impl Collection for TGeomPointSequence

Source§

impl Collection for TGeomPointSequenceSet

Source§

impl Collection for TIntInstant

Source§

impl Collection for TIntSequence

Source§

impl Collection for TIntSequenceSet

Source§

impl Collection for TTextInstant

Source§

impl Collection for TTextSequence

Source§

impl Collection for TTextSequenceSet

Source§

impl Collection for TsTzSpan

Source§

impl Collection for TsTzSpanSet