pub enum Reference {
Plain([u8; 32]),
Encrypted([u8; 64]),
}Expand description
Swarm content reference. 32 bytes for a plain CAC reference, 64 bytes for an encrypted reference (CAC address || encryption key).
Variants§
Plain([u8; 32])
Plain 32-byte reference (BMT root over the chunk).
Encrypted([u8; 64])
Encrypted 64-byte reference (32-byte CAC addr || 32-byte key).
Implementations§
Source§impl Reference
impl Reference
Sourcepub const ALLOWED_LENGTHS: &'static [usize]
pub const ALLOWED_LENGTHS: &'static [usize]
All accepted lengths.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
True for the 64-byte encrypted variant.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Reference> for ResourceLocator
impl From<Reference> for ResourceLocator
impl Eq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnsafeUnpin for Reference
impl UnwindSafe for Reference
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.