WriteCapability

Struct WriteCapability 

Source
pub struct WriteCapability<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> { /* private fields */ }
Expand description

A valid write capability.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let mut cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert_eq!(cap.receiver(), &Alfie);

cap.delegate(&AlfieSecret, Area::new_subspace_area(Alfie), Betty);

assert_eq!(cap.receiver(), &Betty);

Implementations§

Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Source

pub fn receiver(&self) -> &UserPublicKey

Returns the receiver of this capability.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert_eq!(cap.receiver(), &Alfie);
Source

pub fn granted_namespace(&self) -> &NamespacePublicKey

Returns the namespace id to which this grants access.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert_eq!(cap.granted_namespace(), &Family);
Source

pub fn granted_area_ref(&self) -> Option<&Area<MCL, MCC, MPL, UserPublicKey>>

Returns a reference to the area to which this grants access, or None if there is no delegation step which restricts the initial area.

This method is slightly inconvenient to work with (you need special logic if there are no delegation steps), but it is efficient because it never explicitly creates a new area value. For the more convenient version, see granted_area.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::{*, raw::Delegation};

let mut cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert_eq!(cap.granted_area_ref(), None);

cap.delegate(&AlfieSecret, Area::new_subspace_area(Alfie), Betty);

assert_eq!(cap.granted_area_ref(), Some(&Area::new_subspace_area(Alfie)));
Source

pub fn genesis( &self, ) -> &Genesis<NamespacePublicKey, NamespaceSignature, UserPublicKey>

Returns the Genesis of this capability.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::{*, raw::*};

let cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert_eq!(
    cap.genesis(),
    &Genesis::Communal(CommunalGenesis {
        access_mode: AccessMode::Write,
        namespace_key: Family,
        user_key: Alfie,
    }),
);
Source

pub fn is_owned(&self) -> bool

Returns true if and only if this is an owned capability.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let owncap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_owned(&FamilySecret, Alfie);

assert!(owncap.is_owned());

let comcap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert!(!comcap.is_owned());
Source

pub fn delegations( &self, ) -> &[Delegation<MCL, MCC, MPL, UserPublicKey, UserSignature>]

Returns the Delegations of this capability as a slice.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::{*, raw::Delegation};

let mut cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert!(cap.delegations().is_empty());

cap.delegate(&AlfieSecret, Area::new_subspace_area(Alfie), Betty);

assert_eq!(cap.delegations().len(), 1);
Source

pub fn new_communal( namespace_key: NamespacePublicKey, user_key: UserPublicKey, ) -> Self

Creates a new communal write capability with no delegations.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert!(!cap.is_owned());
assert_eq!(cap.receiver(), &Alfie);
assert_eq!(cap.granted_namespace(), &Family);
assert_eq!(cap.granted_area(), Area::new_subspace_area(Alfie));
assert!(cap.delegations().is_empty());
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Clone, UserPublicKey: EncodableKnownLength,

Source

pub fn new_owned<NamespaceKeypair>( keypair: &NamespaceKeypair, user_key: UserPublicKey, ) -> Self
where NamespaceKeypair: Signer<NamespaceSignature> + Keypair<VerifyingKey = NamespacePublicKey>,

Creates a new owned write capability with no delegations.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_owned(&FamilySecret, Alfie);

assert!(cap.is_owned());
assert_eq!(cap.receiver(), &Alfie);
assert_eq!(cap.granted_namespace(), &Family);
assert_eq!(cap.granted_area(), Area::full());
assert!(cap.delegations().is_empty());
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where UserPublicKey: PartialEq,

Source

pub fn includes_area(&self, area: &Area<MCL, MCC, MPL, UserPublicKey>) -> bool

Returns whether the given area is contained in the granted area of this capability.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let mut cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert!(cap.includes_area(&Area::new_subspace_area(Alfie)));
assert!(!cap.includes_area(&Area::full()));
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where UserPublicKey: PartialEq + Clone,

Source

pub fn granted_area(&self) -> Area<MCL, MCC, MPL, UserPublicKey>

Returns by value the area to which this grants access.

Prefer using includes, includes_area or granted_area_ref whenever applicable, as these are more efficient.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::{*, raw::Delegation};

let mut cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert_eq!(cap.granted_area(), Area::new_subspace_area(Alfie));

cap.delegate(&AlfieSecret, Area::new_subspace_area(Alfie), Betty);

assert_eq!(cap.granted_area(), Area::new_subspace_area(Alfie));
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where UserPublicKey: PartialEq, NamespacePublicKey: PartialEq,

Source

pub fn includes<T>(&self, t: &T) -> bool
where T: Namespaced<NamespacePublicKey> + Coordinatelike<MCL, MCC, MPL, UserPublicKey> + ?Sized,

Returns whether the given namespaced coordinate is covered by this capability.

use willow_data_model::{prelude::*, test_parameters::*};
use meadowcap::*;

let alfies_entry = Entry::builder()
    .namespace_id(Family)
    .subspace_id(Alfie)
    .path(Path::<4, 4, 4>::new())
    .timestamp(12345)
    .payload_digest(Spades)
    .payload_length(2)
    .build().unwrap();

let bettys_entry = Entry::prefilled_builder(&alfies_entry)
    .subspace_id(Betty)
    .build().unwrap();

let mut cap = WriteCapability::<
    4, 4, 4,
    TestNamespace,
    TestNamespaceSignature,
    TestSubspace,
    TestSubspaceSignature,
>::new_communal(Family, Alfie);

assert!(cap.includes(&alfies_entry));
assert!(!cap.includes(&bettys_entry));
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Verifier<NamespaceSignature> + EncodableKnownLength, NamespaceSignature: EncodableKnownLength, UserPublicKey: Verifier<UserSignature> + EncodableKnownLength + PartialEq + Clone, UserSignature: EncodableKnownLength,

Source

pub fn try_delegate<UserKeypair>( &mut self, keypair: &UserKeypair, new_area: Area<MCL, MCC, MPL, UserPublicKey>, new_receiver: UserPublicKey, ) -> Result<(), InvalidCapability>
where UserKeypair: Signer<UserSignature> + Keypair<VerifyingKey = UserPublicKey>,

Delegates this capability, returning an error if the resulting granted area would not be included in the previous granted area, or if the public key of the keypair was not the receiver of the capability pre-delegation.

Source

pub fn delegate<UserKeypair>( &mut self, keypair: &UserKeypair, new_area: Area<MCL, MCC, MPL, UserPublicKey>, new_receiver: UserPublicKey, )
where UserKeypair: Signer<UserSignature> + Keypair<VerifyingKey = UserPublicKey>,

Delegates this capability, panicking if the resulting granted area would not be included in the previous granted area, or if the public key of the keypair was not the receiver of the capability pre-delegation.

Trait Implementations§

Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey: Clone, NamespaceSignature: Clone, UserPublicKey: Clone, UserSignature: Clone> Clone for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Source§

fn clone( &self, ) -> WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Debug for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Debug, NamespaceSignature: Debug, UserPublicKey: Debug, UserSignature: Debug,

Source§

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

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

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Decodable for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Verifier<NamespaceSignature> + EncodableKnownLength + DecodableCanonic<ErrorCanonic: Into<Blame>>, NamespaceSignature: EncodableKnownLength + DecodableCanonic<ErrorCanonic: Into<Blame>>, UserPublicKey: Verifier<UserSignature> + EncodableKnownLength + DecodableCanonic<ErrorReason: Into<Blame>, ErrorCanonic: Into<Blame>> + Clone + PartialEq, UserSignature: EncodableKnownLength + DecodableCanonic<ErrorCanonic: Into<Blame>>,

Implements decoding according to the EncodeMcCapability encoding relation, and further errors if the decoded capability is a read capability.

Source§

type ErrorReason = Blame

Reason why decoding can fail (beyond an unexpected end of input or a producer error).
Source§

async fn decode<P>( producer: &mut P, ) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorReason>>
where P: BulkProducer<Item = u8> + ?Sized, Self: Sized,

Decodes the symbols produced by the given bulk producer into a Self, or yields an error if the producer does not produce a valid encoding. Read more
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> DecodableCanonic for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Verifier<NamespaceSignature> + EncodableKnownLength + DecodableCanonic<ErrorCanonic: Into<Blame>>, NamespaceSignature: EncodableKnownLength + DecodableCanonic<ErrorCanonic: Into<Blame>>, UserPublicKey: Verifier<UserSignature> + EncodableKnownLength + DecodableCanonic<ErrorReason: Into<Blame>, ErrorCanonic: Into<Blame>> + Clone + PartialEq, UserSignature: EncodableKnownLength + DecodableCanonic<ErrorCanonic: Into<Blame>>,

Implements decoding according to the encode_mc_capability encoding function, and further errors if the decoded capability is a read capability.

Source§

type ErrorCanonic = Blame

The type for reporting that the sequence of symbols to decode was not a valid canonic encoding of any value of type Self. Read more
Source§

async fn decode_canonic<P>( producer: &mut P, ) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorCanonic>>
where P: BulkProducer<Item = u8> + ?Sized, Self: Sized,

Decodes the symbols produced by the given bulk producer into a Self, and errors if the input encoding is not the canonical one.
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Encodable for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Encodable, NamespaceSignature: Encodable, UserPublicKey: Encodable + PartialEq + Clone, UserSignature: Encodable,

Implements encoding according to the encode_mc_capability encoding function.

Source§

async fn encode<C>(&self, consumer: &mut C) -> Result<(), C::Error>
where C: BulkConsumer<Item = u8> + ?Sized,

Writes an encoding of &self into the given bulk consumer. Read more
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> EncodableKnownLength for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: EncodableKnownLength, NamespaceSignature: EncodableKnownLength, UserPublicKey: EncodableKnownLength + PartialEq + Clone, UserSignature: EncodableKnownLength,

Source§

fn len_of_encoding(&self) -> usize

Computes the number of symbols of the encoding of self. A successful call to encode must feed exactly that many symbols into the bulk consumer.
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> From<WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>> for PossiblyValidWriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Source§

fn from( value: WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>, ) -> Self

Converts to this type from the input type.
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey: Hash, NamespaceSignature: Hash, UserPublicKey: Hash, UserSignature: Hash> Hash for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey: PartialEq, NamespaceSignature: PartialEq, UserPublicKey: PartialEq, UserSignature: PartialEq> PartialEq for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Source§

fn eq( &self, other: &WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey: Eq, NamespaceSignature: Eq, UserPublicKey: Eq, UserSignature: Eq> Eq for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> StructuralPartialEq for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>

Auto Trait Implementations§

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Freeze for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Freeze, UserPublicKey: Freeze, NamespaceSignature: Freeze,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> RefUnwindSafe for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: RefUnwindSafe, UserPublicKey: RefUnwindSafe, NamespaceSignature: RefUnwindSafe, UserSignature: RefUnwindSafe,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Send for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Send, UserPublicKey: Send, NamespaceSignature: Send, UserSignature: Send,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Sync for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Sync, UserPublicKey: Sync, NamespaceSignature: Sync, UserSignature: Sync,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> Unpin for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: Unpin, UserPublicKey: Unpin, NamespaceSignature: Unpin, UserSignature: Unpin,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature> UnwindSafe for WriteCapability<MCL, MCC, MPL, NamespacePublicKey, NamespaceSignature, UserPublicKey, UserSignature>
where NamespacePublicKey: UnwindSafe, UserPublicKey: UnwindSafe, NamespaceSignature: UnwindSafe, UserSignature: UnwindSafe,

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, S> EncodableExt<S> for T
where T: Encodable<S>,

Source§

async fn new_vec_storing_encoding(&self) -> Vec<Symbol>
where Symbol: Default,

Returns a Vec storing the encoding of self. Read more
Source§

impl<T, S> EncodableKnownLengthExt<S> for T

Source§

async fn new_boxed_slice_storing_encoding(&self) -> Box<[Symbol]>
where Symbol: Default,

Returns a Box<[Symbol]> storing the encoding of self. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.