#[non_exhaustive]pub enum RemovalArchive {
Archive(EventId),
Waived,
}Expand description
What a removal recorded about the archive: the reference of the archive taken in the removed member’s last suspension, or the administrator’s waiver.
On the wire it is the archive reference (the manifest’s event ID, 64
lowercase hex digits) or the string "waived". The two cannot be
confused: an event ID is never "waived".
§Examples
use stratum_node_core::{EventId, RemovalArchive};
let waived: RemovalArchive = "waived".parse()?;
assert_eq!(waived, RemovalArchive::Waived);
let id = EventId::from_bytes([1; 32]);
let archived: RemovalArchive = id.to_hex().parse()?;
assert_eq!(archived, RemovalArchive::Archive(id));
assert_eq!(serde_json::to_string(&waived)?, "\"waived\"");
assert!("WAIVED".parse::<RemovalArchive>().is_err());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Archive(EventId)
An archive was taken in the member’s current generation and suspension; this is its manifest’s event ID.
Waived
The administrator removed the member without an archive.
Trait Implementations§
Source§impl Clone for RemovalArchive
impl Clone for RemovalArchive
impl Copy for RemovalArchive
Source§impl Debug for RemovalArchive
impl Debug for RemovalArchive
Source§impl<'de> Deserialize<'de> for RemovalArchive
impl<'de> Deserialize<'de> for RemovalArchive
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for RemovalArchive
impl Display for RemovalArchive
impl Eq for RemovalArchive
Source§impl FromStr for RemovalArchive
impl FromStr for RemovalArchive
Source§impl Hash for RemovalArchive
impl Hash for RemovalArchive
Source§impl PartialEq for RemovalArchive
impl PartialEq for RemovalArchive
Source§impl Serialize for RemovalArchive
impl Serialize for RemovalArchive
impl StructuralPartialEq for RemovalArchive
Auto Trait Implementations§
impl Forget for RemovalArchive
impl Freeze for RemovalArchive
impl Move for RemovalArchive
impl RefUnwindSafe for RemovalArchive
impl Send for RemovalArchive
impl Sync for RemovalArchive
impl Unpin for RemovalArchive
impl UnsafeUnpin for RemovalArchive
impl UnwindSafe for RemovalArchive
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