Authenticate using registry - part 3

This commit is contained in:
mdecimus
2026-02-06 18:50:59 +01:00
parent 1a780ca294
commit 22e5f5a5ab
62 changed files with 2549 additions and 2156 deletions

View File

@@ -516,7 +516,7 @@ impl InMemoryStore {
}
}
pub fn as_store(&self) -> Option<&Store> {
pub fn into_store(self) -> Option<Store> {
match self {
InMemoryStore::Store(store) => Some(store),
_ => None,

View File

@@ -11,11 +11,19 @@ use registry::{
};
impl RegistryStore {
pub async fn get<T: ObjectType>(&self, id: Id) -> trc::Result<Option<T>> {
pub async fn id<T: ObjectType>(&self, id: Id) -> trc::Result<Option<T>> {
todo!()
}
pub async fn insert<T: ObjectType>(&self, object: &T) -> trc::Result<bool> {
pub async fn object<T: ObjectType>(&self, id: impl Into<u64>) -> trc::Result<Option<T>> {
self.id(Id::new(T::object(), id.into())).await
}
pub async fn singleton<T: ObjectType>(&self) -> trc::Result<Option<T>> {
self.id(T::object().singleton()).await
}
pub async fn insert<T: ObjectType>(&self, object: &T) -> trc::Result<Id> {
todo!()
}