#[non_exhaustive]pub struct PeerRecord {
pub id: String,
pub name: String,
pub certificate: Option<PeerId>,
pub pins: Vec<Pin>,
pub email: Option<String>,
pub groups: Vec<String>,
pub disabled: bool,
pub made_unix: Option<i64>,
}Expand description
One accepted peer as a [Table] keeps it, keyed by name.
It derives guatiao’s ToValue, FromValue and Schema, so a [Table] may keep it in
any format.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringStable identity; what a [Verdict::Valid] lookup names.
name: StringThe peer’s name; unique in the table.
certificate: Option<PeerId>The SHA-256 fingerprint of a certificate it pins: written in its canonical form, read
in any spelling coqui-peer-tls reads. Absent for an account pinned by other means.
pins: Vec<Pin>Further pins, each naming its kind (fingerprint or key): with certificate,
everything the account is known by. A certificate renewed on the same key keeps a
key pin. An account holds at least one pin and at most the provider’s max_pins.
email: Option<String>Email address.
groups: Vec<String>Directory groups.
disabled: boolA disabled peer is refused.
made_unix: Option<i64>When it was accepted, in seconds since the Unix epoch.
Implementations§
Source§impl PeerRecord
impl PeerRecord
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
certificate: &PeerId,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, certificate: &PeerId, ) -> Self
An enabled peer with no groups, accepted by this fingerprint.
Sourcepub fn keyed(id: impl Into<String>, name: impl Into<String>, pin: Pin) -> Self
pub fn keyed(id: impl Into<String>, name: impl Into<String>, pin: Pin) -> Self
An enabled peer with no groups, accepted by pin: a public key, say, so a renewed
certificate on the same key signs in.
Sourcepub fn groups(self, groups: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn groups(self, groups: impl IntoIterator<Item = impl Into<String>>) -> Self
Sets the directory groups.
Trait Implementations§
Source§impl Clone for PeerRecord
impl Clone for PeerRecord
Source§impl Debug for PeerRecord
impl Debug for PeerRecord
impl Eq for PeerRecord
Source§impl FromValue for PeerRecord
impl FromValue for PeerRecord
Source§const KINDS: Kinds = ::coqui_access::guatiao::Kinds::MAP
const KINDS: Kinds = ::coqui_access::guatiao::Kinds::MAP
from_value may accept; any
other is refused. Every impl in this crate and every derived one
says; the default, [Kinds::ANY], claims every kind, which keeps
a type that does not say out of an enum told apart by kind.Source§fn from_value(__value: &Value) -> Result<Self, MapError>
fn from_value(__value: &Value) -> Result<Self, MapError>
Source§impl FromWalk for PeerRecord
impl FromWalk for PeerRecord
Source§impl Keyed for PeerRecord
impl Keyed for PeerRecord
Source§impl MapRead for PeerRecord
impl MapRead for PeerRecord
Source§impl PartialEq for PeerRecord
impl PartialEq for PeerRecord
Source§impl Schema for PeerRecord
impl Schema for PeerRecord
impl StructuralPartialEq for PeerRecord
Source§impl ToValue for PeerRecord
impl ToValue for PeerRecord
Auto Trait Implementations§
impl Freeze for PeerRecord
impl RefUnwindSafe for PeerRecord
impl Send for PeerRecord
impl Sync for PeerRecord
impl Unpin for PeerRecord
impl UnsafeUnpin for PeerRecord
impl UnwindSafe for PeerRecord
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.