Struct near_sdk::collections::LookupSet [−][src]
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]
T: BorshSerialize,
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]
Vec<u8>: BorshDeserialize,
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
[src]
pub fn try_from_slice(v: &[u8]) -> Result<Self, Error>
[src]
pub fn is_u8() -> bool
[src]
impl<T> BorshSerialize for LookupSet<T> where
Vec<u8>: BorshSerialize,
[src]
Vec<u8>: BorshSerialize,
Auto Trait Implementations
impl<T> RefUnwindSafe for LookupSet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for LookupSet<T> where
T: Send,
T: Send,
impl<T> Sync for LookupSet<T> where
T: Sync,
T: Sync,
impl<T> Unpin for LookupSet<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for LookupSet<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,