[][src]Struct near_sdk::collections::LookupSet

pub struct LookupSet<T> { /* fields omitted */ }

An non-iterable implementation of a set that stores its content directly on the trie.

Implementations

impl<T> LookupSet<T>[src]

pub fn new(element_prefix: Vec<u8>) -> Self[src]

Create a new map. Use element_prefix as a unique prefix for trie keys.

pub fn insert_raw(&mut self, element_raw: &[u8]) -> bool[src]

Inserts a serialized element into the set. If the set did not have this value present, true is returned. If the set did have this value present, false is returned.

pub fn remove_raw(&mut self, element_raw: &[u8]) -> bool[src]

Removes a serialized element from the set. Returns true if the element was present in the set.

impl<T> LookupSet<T> where
    T: BorshSerialize
[src]

pub fn contains(&self, element: &T) -> bool[src]

Returns true if the set contains an element.

pub fn remove(&mut self, element: &T) -> bool[src]

Removes a value from the set. Returns whether the value was present in the set.

pub fn insert(&mut self, element: &T) -> bool[src]

Adds a value to the set. If the set did not have this value present, true is returned. If the set did have this value present, false is returned.

pub fn extend<IT: IntoIterator<Item = T>>(&mut self, iter: IT)[src]

Trait Implementations

impl<T> BorshDeserialize for LookupSet<T> where
    Vec<u8>: BorshDeserialize
[src]

impl<T> BorshSerialize for LookupSet<T> where
    Vec<u8>: BorshSerialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for LookupSet<T> where
    T: RefUnwindSafe

impl<T> Send for LookupSet<T> where
    T: Send

impl<T> Sync for LookupSet<T> where
    T: Sync

impl<T> Unpin for LookupSet<T> where
    T: Unpin

impl<T> UnwindSafe for LookupSet<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.