cosmian_kms_interfaces 5.11.0

Crate exposing APIs for plugins to the Cosmian KMS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub(crate) mod object_with_metadata;
mod objects_store;
mod permissions_store;

pub use object_with_metadata::ObjectWithMetadata;
pub use objects_store::{AtomicOperation, ObjectsStore};
pub use permissions_store::PermissionsStore;

pub trait SessionParams: Sync + Send {}

impl dyn SessionParams + 'static {
    /// Downcast the `SessionParams` to a concrete type.
    #[inline]
    #[expect(unsafe_code)]
    pub fn downcast_ref<T: SessionParams + 'static>(&self) -> &T {
        unsafe { &*std::ptr::from_ref::<dyn SessionParams>(self).cast::<T>() }
    }
}