Struct cryptographic_message_syntax::asn1::rfc3161::Accuracy
source · pub struct Accuracy {
pub seconds: Option<Integer>,
pub millis: Option<Integer>,
pub micros: Option<Integer>,
}Expand description
Accuracy
Accuracy ::= SEQUENCE {
seconds INTEGER OPTIONAL,
millis [0] INTEGER (1..999) OPTIONAL,
micros [1] INTEGER (1..999) OPTIONAL }
Fields§
§seconds: Option<Integer>§millis: Option<Integer>§micros: Option<Integer>Implementations§
source§impl Accuracy
impl Accuracy
sourcepub fn take_opt_from<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Option<Self>, DecodeError<S::Error>>
pub fn take_opt_from<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Option<Self>, DecodeError<S::Error>>
Examples found in repository?
src/asn1/rfc3161.rs (line 400)
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
pub fn take_from<S: Source>(cons: &mut Constructed<S>) -> Result<Self, DecodeError<S::Error>> {
cons.take_sequence(|cons| {
let version = Integer::take_from(cons)?;
let policy = TsaPolicyId::take_from(cons)?;
let message_imprint = MessageImprint::take_from(cons)?;
let serial_number = Integer::take_from(cons)?;
let gen_time = GeneralizedTime::take_from_allow_fractional_z(cons)?;
let accuracy = Accuracy::take_opt_from(cons)?;
let ordering = cons.take_opt_bool()?;
let nonce =
cons.take_opt_primitive_if(Tag::INTEGER, |prim| Integer::from_primitive(prim))?;
let tsa =
cons.take_opt_constructed_if(Tag::CTX_0, |cons| GeneralName::take_from(cons))?;
let extensions =
cons.take_opt_constructed_if(Tag::CTX_1, |cons| Extensions::take_from(cons))?;
Ok(Self {
version,
policy,
message_imprint,
serial_number,
gen_time,
accuracy,
ordering,
nonce,
tsa,
extensions,
})
})
}sourcepub fn from_sequence<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Self, DecodeError<S::Error>>
pub fn from_sequence<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Self, DecodeError<S::Error>>
sourcepub fn encode_ref(&self) -> impl Values + '_
pub fn encode_ref(&self) -> impl Values + '_
Examples found in repository?
src/asn1/rfc3161.rs (line 431)
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
pub fn encode_ref(&self) -> impl Values + '_ {
encode::sequence((
(&self.version).encode(),
self.policy.encode_ref(),
self.message_imprint.encode_ref(),
(&self.serial_number).encode(),
self.gen_time.encode_ref(),
self.accuracy.as_ref().map(|accuracy| accuracy.encode_ref()),
self.ordering.as_ref().map(|ordering| ordering.encode_ref()),
self.nonce.as_ref().map(|nonce| nonce.encode()),
self.tsa
.as_ref()
.map(|tsa| tsa.encode_ref().explicit(Tag::CTX_0)),
self.extensions
.as_ref()
.map(|extensions| extensions.encode_ref_as(Tag::CTX_1)),
))
}Trait Implementations§
source§impl PartialEq<Accuracy> for Accuracy
impl PartialEq<Accuracy> for Accuracy
impl Eq for Accuracy
impl StructuralEq for Accuracy
impl StructuralPartialEq for Accuracy
Auto Trait Implementations§
impl RefUnwindSafe for Accuracy
impl Send for Accuracy
impl Sync for Accuracy
impl Unpin for Accuracy
impl UnwindSafe for Accuracy
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.