pub struct ServerId {
pub keys: Keys,
pub sponsor_id: Id,
pub timestamp: TimeMillis,
pub hash: Hash,
pub salt: Salt,
pub pow: Pow,
pub id: Id,
}Fields§
§keys: Keys§sponsor_id: Id§timestamp: TimeMillis§hash: Hash§salt: Salt§pow: Pow§id: IdImplementations§
Source§impl ServerId
impl ServerId
pub fn id_hex(&self) -> String
pub fn server_pow_hash_to_id(hash: Hash) -> Result<Id>
pub async fn pow_generate( time_provider: &dyn TimeProvider, pow_min: Pow, sponsor_id: &Id, verification_key: &VerificationKeyBytes, pq_commitment_bytes: &PQCommitmentBytes, content_hash: &Hash, pow_generator: &dyn ParallelPowGenerator, ) -> Result<(TimeMillis, Salt, Pow, Hash)>
pub fn pow_measure( sponsor_id: &Id, verification_key: &VerificationKeyBytes, pqcommitment_bytes: &PQCommitmentBytes, timestamp_be: &TimeMillisBytes, content_hash: &Hash, salt: &Salt, ) -> Result<(Pow, Hash)>
pub async fn new( time_provider: &dyn TimeProvider, pow_min: Pow, skip_pq_commitment_bytes: bool, pow_generator: &dyn ParallelPowGenerator, ) -> Result<Self>
pub fn to_peer(&self, time_provider: &dyn TimeProvider) -> Result<Peer>
pub fn verify(&self) -> Result<()>
pub fn encode(&self) -> Result<Vec<u8>>
pub fn decode(bytes: &[u8]) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServerId
impl RefUnwindSafe for ServerId
impl Send for ServerId
impl Sync for ServerId
impl Unpin for ServerId
impl UnsafeUnpin for ServerId
impl UnwindSafe for ServerId
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.