Be aware: Foundation will NEVER ask for your seed words, device PIN, or call you unexpectedly. If anyone does, it's a scam.

Struct

AppSeed

pub struct AppSeed(/* private fields */);
Expand description

The 32-byte per-app seed the security element derives for a calling app.

A distinct type (annotated like Seed) so the zeroize-on-drop treatment follows the bytes wherever an AppSeed flows, and a call site can’t quietly pass an unrelated array where a seed is expected. Raw [u8; 32] copies a caller makes from as_bytes still escape scrubbing (Rust move semantics), so this narrows the exposure window rather than closing it.

Implementations

impl AppSeed

pub fn new(bytes: [u8; 32]) -> Self

Permission: not needed

pub fn as_bytes(&self) -> &[u8; 32]

Permission: not needed

Trait Implementations

impl Archive for AppSeed
where [u8; 32]: Archive,

const COPY_OPTIMIZATION: CopyOptimization<Self>

An optimization flag that allows the bytes of this type to be copied directly to a writer instead of calling serialize. Read more

type Archived = ArchivedAppSeed

The archived representation of this type. Read more

type Resolver = AppSeedResolver

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.

fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)

Creates the archived version of this value at the given position and writes it to the given output. Read more

impl Clone for AppSeed

fn clone(&self) -> AppSeed

Returns a duplicate of the value. Read more
1.0.0

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

impl<__D: Fallible + ?Sized> Deserialize<AppSeed, __D> for Archived<AppSeed>
where [u8; 32]: Archive, <[u8; 32] as Archive>::Archived: Deserialize<[u8; 32], __D>,

fn deserialize( &self, deserializer: &mut __D, ) -> Result<AppSeed, <__D as Fallible>::Error>

Deserializes using the given deserializer

impl Drop for AppSeed

fn drop(&mut self)

Executes the destructor for this type. Read more

impl<__S: Fallible + ?Sized> Serialize<__S> for AppSeed
where [u8; 32]: Serialize<__S>,

fn serialize( &self, serializer: &mut __S, ) -> Result<<Self as Archive>::Resolver, <__S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.

Auto Trait Implementations

impl Freeze for AppSeed

impl RefUnwindSafe for AppSeed

impl Send for AppSeed

impl Sync for AppSeed

impl Unpin for AppSeed

impl UnsafeUnpin for AppSeed

impl UnwindSafe for AppSeed