// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
usecrate::{client::MlsError, time::MlsTime}; use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize};
pubfn seconds(s: u64) -> Result<Self, MlsError> { #[cfg(feature = "std")] let not_before = MlsTime::now().seconds_since_epoch(); #[cfg(not(feature = "std"))] // There is no clock on no_std, this is here just so that we can run tests. let not_before = 3600u64;
let not_after = not_before.checked_add(s).ok_or(MlsError::TimeOverflow)?;
Ok(Lifetime { // Subtract 1 hour to address time difference between machines
not_before: not_before - 3600,
not_after,
})
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.