Struct identity_iota::credential::status_list_2021::StatusList2021
source · pub struct StatusList2021(/* private fields */);
Expand description
StatusList2021 data structure as described in W3C’s VC status list 2021.
Implementations§
source§impl StatusList2021
impl StatusList2021
sourcepub fn new(num_entries: usize) -> Result<StatusList2021, StatusListError>
pub fn new(num_entries: usize) -> Result<StatusList2021, StatusListError>
Returns a new zero-filled StatusList2021
that can hold num_entries
credential statuses.
§Notes:
- The actual length of the list will be rounded up to the closest multiple of 8 to accomodate for byte sizes.
num_entries
must be at least 131,072 which corresponds to a size of 16KB.
sourcepub fn get(&self, index: usize) -> Result<bool, StatusListError>
pub fn get(&self, index: usize) -> Result<bool, StatusListError>
Returns the status of the index
-th entry, if it exists.
sourcepub fn set(&mut self, index: usize, value: bool) -> Result<(), StatusListError>
pub fn set(&mut self, index: usize, value: bool) -> Result<(), StatusListError>
Sets the status of the index
-th entry to value
.
sourcepub fn try_from_encoded_str(s: &str) -> Result<StatusList2021, StatusListError>
pub fn try_from_encoded_str(s: &str) -> Result<StatusList2021, StatusListError>
Attempts to parse a StatusList2021
from a string, following the
StatusList2021 expansion algorithm.
sourcepub fn into_encoded_str(self) -> String
pub fn into_encoded_str(self) -> String
Encode this StatusList2021
into its string representation following
StatusList2021 generation algorithm.
Trait Implementations§
source§impl Clone for StatusList2021
impl Clone for StatusList2021
source§fn clone(&self) -> StatusList2021
fn clone(&self) -> StatusList2021
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StatusList2021
impl Debug for StatusList2021
source§impl Default for StatusList2021
impl Default for StatusList2021
source§fn default() -> StatusList2021
fn default() -> StatusList2021
Returns the “default value” for a type. Read more
source§impl Hash for StatusList2021
impl Hash for StatusList2021
source§impl PartialEq for StatusList2021
impl PartialEq for StatusList2021
source§fn eq(&self, other: &StatusList2021) -> bool
fn eq(&self, other: &StatusList2021) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for StatusList2021
impl StructuralPartialEq for StatusList2021
Auto Trait Implementations§
impl Freeze for StatusList2021
impl RefUnwindSafe for StatusList2021
impl Send for StatusList2021
impl Sync for StatusList2021
impl Unpin for StatusList2021
impl UnwindSafe for StatusList2021
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.