pub struct Device<S> { /* private fields */ }Expand description
A Device identifies the local node through its NodeId, and carries its
signing mechanism.
The signing mechanism is for node specific cryptography, e.g. signing
rad/sigrefs, COB commits, node messages, etc.
Note that a Device can create Signatures and ExtendedSignatures.
It can achieve this as long as S implements Signer<Signature>.
Implementations§
Source§impl<S> Device<S>
impl<S> Device<S>
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Return the crypto::PublicKey of the Device.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Convert the Device into its signer.
This consumes the Device.
Source§impl<S> Device<S>where
S: BoxableSigner + 'static,
impl<S> Device<S>where
S: BoxableSigner + 'static,
Sourcepub fn boxed(self) -> BoxedDevice
pub fn boxed(self) -> BoxedDevice
Construct a BoxedDevice from a given Device.
Trait Implementations§
Source§impl AsRef<Device<BoxedSigner>> for BoxedDevice
impl AsRef<Device<BoxedSigner>> for BoxedDevice
Source§fn as_ref(&self) -> &Device<BoxedSigner>
fn as_ref(&self) -> &Device<BoxedSigner>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<S> KeypairRef for Device<S>
impl<S> KeypairRef for Device<S>
Source§type VerifyingKey = PublicKey
type VerifyingKey = PublicKey
Verifying key type for this keypair.
Source§impl<S> Signer<ExtendedSignature> for Device<S>
impl<S> Signer<ExtendedSignature> for Device<S>
Auto Trait Implementations§
impl<S> Freeze for Device<S>where
S: Freeze,
impl<S> RefUnwindSafe for Device<S>where
S: RefUnwindSafe,
impl<S> Send for Device<S>where
S: Send,
impl<S> Sync for Device<S>where
S: Sync,
impl<S> Unpin for Device<S>where
S: Unpin,
impl<S> UnsafeUnpin for Device<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Device<S>where
S: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<K> Keypair for Kwhere
K: KeypairRef,
impl<K> Keypair for Kwhere
K: KeypairRef,
Source§type VerifyingKey = <K as KeypairRef>::VerifyingKey
type VerifyingKey = <K as KeypairRef>::VerifyingKey
Verifying key type for this keypair.
Source§fn verifying_key(&self) -> <K as Keypair>::VerifyingKey
fn verifying_key(&self) -> <K as Keypair>::VerifyingKey
Get the verifying key which can verify signatures produced by the
signing key portion of this keypair.
Source§impl<S> Signer for S
impl<S> Signer for S
Source§fn public_key(&self) -> &PublicKey
fn public_key(&self) -> &PublicKey
Return this signer’s public/verification key.