Skip to main content

Level

Enum Level 

Source
pub enum Level {
    Classic,
    QuantumSafe,
}
Expand description

How the key ring is wrapped: chosen per repository, in the members file.

A new repository is quantum-safe (Level::NEW, owner 2026-10-30, CRYPT-PQ-DEFAULT), and so is a new person’s key. A members file WITHOUT a level line is classic (Level::UNSTATED): an existing repository keeps its level, and nothing is migrated. Level::default() is Level::NEW.

Variants§

§

Classic

Wrapped to members’ X25519 (age1…) encryption keys: a ring harvested today opens once a quantum computer breaks X25519. The visible opt-out (gunnar crypt init --level classic) for members whose one key is classic.

§

QuantumSafe

Wrapped ONLY to age’s hybrid ML-KEM-768 + X25519 recipients (age1pq1…): no stanza a quantum computer could open. The default.

Implementations§

Source§

impl Level

Source

pub const NEW: Level = Level::QuantumSafe

The level of a new repository and of a new person’s key, unless asked otherwise: quantum-safe (owner 2026-10-30, CRYPT-PQ-DEFAULT). The CLI (gunnar crypt init, gunnar crypt key new) and the console read it here, so the default lives in one place.

Source

pub const UNSTATED: Level = Level::Classic

The level of a members file without a level line: classic, as every file was before the line existed. An existing repository keeps its level.

Source

pub fn word(self) -> &'static str

The word in the members file (level quantum-safe).

Source

pub fn takes(self, kind: KeyKind) -> bool

Does a key of kind belong in a ring of this level?

Source

pub fn stanza_types(self) -> &'static [&'static str]

The age stanza types a key file of this level may carry (besides the one random …-grease stanza age adds to every file).

Trait Implementations§

Source§

impl Clone for Level

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Level

Source§

impl Debug for Level

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Level

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Level

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Level

Source§

impl FromStr for Level

Source§

fn from_str(word: &str) -> Result<Level, String>

classic or quantum-safe, the words of the members file and of --level.

Source§

type Err = String

The associated error which can be returned from parsing.
Source§

impl PartialEq for Level

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Level

Auto Trait Implementations§

§

impl Freeze for Level

§

impl RefUnwindSafe for Level

§

impl Send for Level

§

impl Sync for Level

§

impl Unpin for Level

§

impl UnsafeUnpin for Level

§

impl UnwindSafe for Level

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V