Struct tantivy_common::TinySet

source ·
pub struct TinySet(/* private fields */);

Implementations§

source§

impl TinySet

source

pub fn serialize<T: Write>(&self, writer: &mut T) -> Result<()>

source

pub fn into_bytes(self) -> [u8; 8]

source

pub fn deserialize(data: [u8; 8]) -> Self

source

pub fn empty() -> TinySet

Returns an empty TinySet.

source

pub fn full() -> TinySet

Returns a full TinySet.

source

pub fn clear(&mut self)

source

pub fn contains(self, el: u32) -> bool

Returns true iff the TinySet contains the element el.

source

pub fn len(self) -> u32

Returns the number of elements in the TinySet.

source

pub fn intersect(self, other: TinySet) -> TinySet

Returns the intersection of self and other

source

pub fn singleton(el: u32) -> TinySet

Creates a new TinySet containing only one element within [0; 64[

source

pub fn insert(self, el: u32) -> TinySet

Insert a new element within [0..64)

source

pub fn remove(self, el: u32) -> TinySet

Removes an element within [0..64)

source

pub fn insert_mut(&mut self, el: u32) -> bool

Insert a new element within [0..64)

returns true if the set changed

source

pub fn remove_mut(&mut self, el: u32) -> bool

Remove a element within [0..64)

returns true if the set changed

source

pub fn union(self, other: TinySet) -> TinySet

Returns the union of two tinysets

source

pub fn is_empty(self) -> bool

Returns true iff the TinySet is empty.

source

pub fn pop_lowest(&mut self) -> Option<u32>

Returns the lowest element in the TinySet and removes it.

source

pub fn range_lower(upper_bound: u32) -> TinySet

Returns a TinySet than contains all values up to limit excluded.

The limit is assumed to be strictly lower than 64.

source

pub fn range_greater_or_equal(from_included: u32) -> TinySet

Returns a TinySet that contains all values greater or equal to the given limit, included. (and up to 63)

The limit is assumed to be strictly lower than 64.

Trait Implementations§

source§

impl Clone for TinySet

source§

fn clone(&self) -> TinySet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinySet

source§

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

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

impl IntoIterator for TinySet

§

type Item = u32

The type of the elements being iterated over.
§

type IntoIter = TinySetIterator

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for TinySet

source§

fn eq(&self, other: &TinySet) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinySet

source§

impl Eq for TinySet

source§

impl StructuralPartialEq for TinySet

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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

§

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

§

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.