Skip to main content

Mutation

Enum Mutation 

Source
pub enum Mutation<'a> {
    Register {
        agent_key: &'a VerifyingKey,
        endpoints: &'a [Endpoint],
        expires_at: SystemTime,
    },
    UpdateEndpoint {
        endpoints: &'a [Endpoint],
        expires_at: SystemTime,
    },
    Refresh {
        ttl: Duration,
        expires_at: SystemTime,
    },
    Deregister,
}
Expand description

A write to an existing registration, with the parameters that write carries.

This mirrors the mutating crate::Dht methods so that the parameters which distinguish two calls of the same kind (which endpoints, how much TTL) are inside what the signature covers, and it names the resulting record’s expires_at so that no field of the record a write produces sits outside the signature.

Variants§

§

Register

Create the record with exactly this content.

Registration is a write like any other and needs the same authorization. Without it, an attestation token lifted from a public record would be enough to re-register that URI pointing anywhere: the token binds the agent key, but nothing would bind the endpoints.

Fields

§agent_key: &'a VerifyingKey

The key the new record will name as its only writer.

§endpoints: &'a [Endpoint]

The endpoints the new record will hold.

§expires_at: SystemTime

When the new record will expire.

§

UpdateEndpoint

Replace the record’s endpoints with these.

A migration does not change when the record lapses, so expires_at is the expiry the record already carries. A store derives it from the record it holds rather than accepting it from the caller, so the two cannot describe the same write differently.

Fields

§endpoints: &'a [Endpoint]

The endpoints the record will hold.

§expires_at: SystemTime

When the record will expire, unchanged by this write.

§

Refresh

Extend the record’s lifetime to this instant.

expires_at is what a store applies. ttl is what the agent asked for, and is signed alongside it because it is an argument of the call: a backend that reports the requested lifetime, or carries it on the wire, must not be able to report one the agent never asked for. The instant is what the record ends up holding, so the instant is what stores act on. Only the signer knows both, because only the signer knows when it signed.

Fields

§ttl: Duration

The lifetime the agent asked for.

§expires_at: SystemTime

When the record will expire once this write is applied.

§

Deregister

Remove the record.

Implementations§

Source§

impl Mutation<'_>

Source

pub const fn kind(&self) -> MutationKind

Returns the kind of operation this mutation performs.

Trait Implementations§

Source§

impl<'a> Clone for Mutation<'a>

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<'a> Copy for Mutation<'a>

Source§

impl<'a> Debug for Mutation<'a>

Source§

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

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

impl<'a> Eq for Mutation<'a>

Source§

impl<'a> PartialEq for Mutation<'a>

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<'a> StructuralPartialEq for Mutation<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Mutation<'a>

§

impl<'a> RefUnwindSafe for Mutation<'a>

§

impl<'a> Send for Mutation<'a>

§

impl<'a> Sync for Mutation<'a>

§

impl<'a> Unpin for Mutation<'a>

§

impl<'a> UnsafeUnpin for Mutation<'a>

§

impl<'a> UnwindSafe for Mutation<'a>

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> 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<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<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> 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, 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