pub struct Valencies(/* private fields */);Methods from Deref<Target = Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>>§
sourcepub fn iter_mut(&'c mut self) -> <&'c mut C as IntoIterator>::IntoIter
pub fn iter_mut(&'c mut self) -> <&'c mut C as IntoIterator>::IntoIter
Returns an iterator that allows modifying each value.
The iterator yields all items from start to end.
sourcepub fn keyed_values_mut(&'c mut self) -> <&'c mut C as IntoIterator>::IntoIter
pub fn keyed_values_mut(&'c mut self) -> <&'c mut C as IntoIterator>::IntoIter
Returns an iterator that allows modifying each value for each key.
sourcepub fn push(&mut self, elem: <C as Collection>::Item) -> Result<(), Error>
pub fn push(&mut self, elem: <C as Collection>::Item) -> Result<(), Error>
Attempts to add a single element to the confined collection. Fails if the number of elements in the collection already maximal.
sourcepub fn extend<T>(&mut self, iter: T) -> Result<(), Error>where
T: IntoIterator<Item = <C as Collection>::Item>,
pub fn extend<T>(&mut self, iter: T) -> Result<(), Error>where T: IntoIterator<Item = <C as Collection>::Item>,
Attempts to add all elements from an iterator to the confined collection. Fails if the number of elements in the collection already maximal.
sourcepub fn len_u8(&self) -> u8
pub fn len_u8(&self) -> u8
Returns number of elements in the confined collection as u8. The
confinement guarantees that the collection length can’t exceed
u8::MAX.
sourcepub fn len_u16(&self) -> u16
pub fn len_u16(&self) -> u16
Returns number of elements in the confined collection as u16. The
confinement guarantees that the collection length can’t exceed
u16::MAX.
sourcepub fn len_u24(&self) -> u24
pub fn len_u24(&self) -> u24
Returns number of elements in the confined collection as u24. The
confinement guarantees that the collection length can’t exceed
u24::MAX.
sourcepub fn len_u32(&self) -> u32
pub fn len_u32(&self) -> u32
Returns number of elements in the confined collection as u32. The
confinement guarantees that the collection length can’t exceed
u32::MAX.
sourcepub fn get_mut(
&mut self,
key: &<C as KeyedCollection>::Key
) -> Option<&mut <C as KeyedCollection>::Value>
pub fn get_mut( &mut self, key: &<C as KeyedCollection>::Key ) -> Option<&mut <C as KeyedCollection>::Value>
Gets mutable reference to an element of the collection.
sourcepub fn insert(
&mut self,
key: <C as KeyedCollection>::Key,
value: <C as KeyedCollection>::Value
) -> Result<Option<<C as KeyedCollection>::Value>, Error>
pub fn insert( &mut self, key: <C as KeyedCollection>::Key, value: <C as KeyedCollection>::Value ) -> Result<Option<<C as KeyedCollection>::Value>, Error>
Inserts a new value into the confined collection under a given key. Fails if the collection already contains maximum number of elements allowed by the confinement.
sourcepub fn pop(&mut self) -> Option<char>
pub fn pop(&mut self) -> Option<char>
Removes the last character from a string and returns it, or None if
it is empty.
sourcepub fn remove(&mut self, index: usize) -> Result<char, Error>
pub fn remove(&mut self, index: usize) -> Result<char, Error>
Removes a single character from the confined string, unless the string doesn’t shorten more than the confinement requirement. Errors otherwise.
sourcepub fn pop(&mut self) -> Option<AsciiChar>
pub fn pop(&mut self) -> Option<AsciiChar>
Removes the last character from a string and returns it, or None if
it is empty.
sourcepub fn remove(&mut self, index: usize) -> Result<AsciiChar, Error>
pub fn remove(&mut self, index: usize) -> Result<AsciiChar, Error>
Removes a single character from the confined string, unless the string doesn’t shorten more than the confinement requirement. Errors otherwise.
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes the last element from a vector and returns it, or None if it
is empty.
sourcepub fn remove(&mut self, index: usize) -> Result<T, Error>
pub fn remove(&mut self, index: usize) -> Result<T, Error>
Removes an element from the vector at a given index. Errors if the index exceeds the number of elements in the vector, of if the new vector length will be less than the confinement requirement. Returns the removed element otherwise.
sourcepub fn iter(&self) -> Iter<'_, T>
pub fn iter(&self) -> Iter<'_, T>
Returns an iterator over the slice.
The iterator yields all items from start to end.
sourcepub fn pop_front(&mut self) -> Option<T>
pub fn pop_front(&mut self) -> Option<T>
Removes the first element and returns it, or None if the deque is
empty.
sourcepub fn pop_back(&mut self) -> Option<T>
pub fn pop_back(&mut self) -> Option<T>
Removes the last element and returns it, or None if the deque is
empty.
sourcepub fn push_from(&mut self, elem: T) -> Result<(), Error>
pub fn push_from(&mut self, elem: T) -> Result<(), Error>
Prepends an element to the deque. Errors if the new collection length will not fit the confinement requirements.
sourcepub fn push_back(&mut self, elem: T) -> Result<(), Error>
pub fn push_back(&mut self, elem: T) -> Result<(), Error>
Appends an element to the deque. Errors if the new collection length will not fit the confinement requirements.
sourcepub fn remove(&mut self, index: usize) -> Result<T, Error>
pub fn remove(&mut self, index: usize) -> Result<T, Error>
Removes an element from the deque at a given index. Errors if the index exceeds the number of elements in the deque, of if the new deque length will be less than the confinement requirement. Returns the removed element otherwise.
sourcepub fn remove(&mut self, elem: &T) -> Result<bool, Error>
pub fn remove(&mut self, elem: &T) -> Result<bool, Error>
Removes an element from the set. Errors if the index exceeds the number of elements in the set, of if the new collection length will be less than the confinement requirement. Returns if the element was present in the set.
sourcepub fn take(&mut self, elem: &T) -> Result<Option<T>, Error>
pub fn take(&mut self, elem: &T) -> Result<Option<T>, Error>
Removes an element from the set. Errors if the index exceeds the number of elements in the set, of if the new collection length will be less than the confinement requirement. Returns the removed element otherwise.
sourcepub fn remove(&mut self, elem: &T) -> Result<bool, Error>
pub fn remove(&mut self, elem: &T) -> Result<bool, Error>
Removes an element from the set. Errors if the index exceeds the number of elements in the set, of if the new collection length will be less than the confinement requirement. Returns if the element was present in the set.
sourcepub fn take(&mut self, elem: &T) -> Result<Option<T>, Error>
pub fn take(&mut self, elem: &T) -> Result<Option<T>, Error>
Removes an element from the set. Errors if the index exceeds the number of elements in the set, of if the new collection length will be less than the confinement requirement. Returns the removed element otherwise.
Trait Implementations§
source§impl AsRef<Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>> for Valencies
impl AsRef<Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>> for Valencies
source§impl Borrow<Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>> for Valencies
impl Borrow<Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>> for Valencies
source§impl CommitStrategy for Valencies
impl CommitStrategy for Valencies
source§impl<'de> Deserialize<'de> for Valencies
impl<'de> Deserialize<'de> for Valencies
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Valencies, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Valencies, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl From<Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>> for Valencies
impl From<Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>> for Valencies
source§impl From<Valencies> for Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
impl From<Valencies> for Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
source§impl<'a> IntoIterator for &'a Valencies
impl<'a> IntoIterator for &'a Valencies
§type Item = ValencyType
type Item = ValencyType
§type IntoIter = Copied<Iter<'a, ValencyType>>
type IntoIter = Copied<Iter<'a, ValencyType>>
source§impl Ord for Valencies
impl Ord for Valencies
source§impl PartialEq for Valencies
impl PartialEq for Valencies
source§impl PartialOrd for Valencies
impl PartialOrd for Valencies
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for Valencies
impl Serialize for Valencies
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
source§impl StrictDecode for Valencies
impl StrictDecode for Valencies
fn strict_decode(reader: &mut impl TypedRead) -> Result<Valencies, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
source§impl StrictEncode for Valencies
impl StrictEncode for Valencies
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where W: TypedWrite,
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
source§impl StrictTuple for Valencies
impl StrictTuple for Valencies
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for Valencies
impl StrictType for Valencies
const STRICT_LIB_NAME: &'static str = LIB_NAME_RGB
fn strict_name() -> Option<TypeName>
source§impl Wrapper for Valencies
impl Wrapper for Valencies
§type Inner = Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
type Inner = Confined<BTreeSet<ValencyType>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
source§fn from_inner(inner: <Valencies as Wrapper>::Inner) -> Valencies
fn from_inner(inner: <Valencies as Wrapper>::Inner) -> Valencies
source§fn as_inner(&self) -> &<Valencies as Wrapper>::Inner
fn as_inner(&self) -> &<Valencies as Wrapper>::Inner
source§impl WrapperMut for Valencies
impl WrapperMut for Valencies
impl Eq for Valencies
impl StrictProduct for Valencies
impl StructuralEq for Valencies
impl StructuralPartialEq for Valencies
Auto Trait Implementations§
impl RefUnwindSafe for Valencies
impl Send for Valencies
impl Sync for Valencies
impl Unpin for Valencies
impl UnwindSafe for Valencies
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
source§impl<T> CommitEncode for Twhere
T: CommitStrategy,
Holder<&'a T, <T as CommitStrategy>::Strategy>: for<'a> CommitEncode,
impl<T> CommitEncode for Twhere T: CommitStrategy, Holder<&'a T, <T as CommitStrategy>::Strategy>: for<'a> CommitEncode,
source§fn commit_encode(&self, e: &mut impl Write)
fn commit_encode(&self, e: &mut impl Write)
io::Write writer instance§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.