use crate::*;
#[wasm_bindgen]
#[derive(
Clone, Debug, Eq, Ord, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize, JsonSchema,
)]
pub struct Certificates(pub(crate) Vec<Certificate>);
impl_to_from!(Certificates);
impl NoneOrEmpty for Certificates {
fn is_none_or_empty(&self) -> bool {
self.0.is_empty()
}
}
#[wasm_bindgen]
impl Certificates {
pub fn new() -> Self {
Self(Vec::new())
}
pub fn len(&self) -> usize {
self.0.len()
}
pub fn get(&self, index: usize) -> Certificate {
self.0[index].clone()
}
pub fn add(&mut self, elem: &Certificate) {
self.0.push(elem.clone());
}
}