synta-certificate 0.2.6

X.509 certificate structures for synta ASN.1 library
Documentation
//! Minimal test for SequenceOf with lifetimes in derive macro

use synta::types::constructed::Element;
use synta::types::primitive::Integer;
use synta::types::SequenceOf;

#[cfg(feature = "derive")]
use synta_derive::Asn1Sequence;

/// Minimal struct with just a SequenceOf field
#[expect(dead_code)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "derive", derive(Asn1Sequence))]
pub struct MinimalStruct<'a> {
    pub data: SequenceOf<'a, Element<'a>>,
}

/// Struct with two non-lifetime fields and one SequenceOf
#[expect(dead_code)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "derive", derive(Asn1Sequence))]
pub struct MixedStruct<'a> {
    pub number: Integer,
    pub data: SequenceOf<'a, Element<'a>>,
}

/// Struct with optional field
#[expect(dead_code)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "derive", derive(Asn1Sequence))]
pub struct OptionalStruct<'a> {
    pub data: SequenceOf<'a, Element<'a>>,
    #[cfg_attr(feature = "derive", asn1(optional))]
    pub opt_data: Option<SequenceOf<'a, Element<'a>>>,
}

/// Struct with tagged field
#[expect(dead_code)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "derive", derive(Asn1Sequence))]
pub struct TaggedStruct<'a> {
    pub data: SequenceOf<'a, Element<'a>>,
    #[cfg_attr(feature = "derive", asn1(tag(1, explicit)))]
    #[cfg_attr(feature = "derive", asn1(optional))]
    pub tagged_data: Option<SequenceOf<'a, Element<'a>>>,
}