Struct aruna_cache::cache::Cache

source ·
pub struct Cache {
    pub relations_cache: DashMap<Resource, DashSet<Resource, RandomState>, RandomState>,
    pub name_cache: DashMap<String, DashSet<Resource, RandomState>, RandomState>,
    pub shared_to_pid: DashMap<DieselUlid, Resource, RandomState>,
    pub pid_to_shared: DashMap<DieselUlid, Resource, RandomState>,
    pub object_cache: DashMap<Resource, ApiResource, RandomState>,
    pub user_cache: DashMap<DieselUlid, User, RandomState>,
    pub pubkeys: DashMap<i32, PubKey, RandomState>,
    pub oidc_ids: DashMap<String, DieselUlid, RandomState>,
    pub lock: Arc<AtomicBool>,
}

Fields§

§relations_cache: DashMap<Resource, DashSet<Resource, RandomState>, RandomState>§name_cache: DashMap<String, DashSet<Resource, RandomState>, RandomState>§shared_to_pid: DashMap<DieselUlid, Resource, RandomState>§pid_to_shared: DashMap<DieselUlid, Resource, RandomState>§object_cache: DashMap<Resource, ApiResource, RandomState>§user_cache: DashMap<DieselUlid, User, RandomState>§pubkeys: DashMap<i32, PubKey, RandomState>§oidc_ids: DashMap<String, DieselUlid, RandomState>§lock: Arc<AtomicBool>

Implementations§

source§

impl Cache

source

pub fn new() -> Self

source

pub fn traverse_graph( &self, from: &Resource ) -> Result<Vec<(Resource, Resource)>>

source

pub fn check_with_targets( &self, from: &Resource, targets: Vec<Resource> ) -> Result<()>

source

pub fn check_from_multi_with_targets( &self, from: Vec<&Resource>, targets: Vec<Resource> ) -> Result<()>

source

pub fn get_parents(&self, from: &Resource) -> Result<Vec<(Resource, Resource)>>

source

pub fn remove_all_res(&self, res: Resource)

source

pub fn add_or_update_shared( &self, shared: DieselUlid, persistent: DieselUlid, variant: ResourceVariant ) -> Result<()>

source

pub fn get_persistent(&self, shared: &DieselUlid) -> Option<Resource>

source

pub fn get_shared(&self, persistent: &DieselUlid) -> Option<Resource>

source

pub fn add_pubkey(&self, id: i32, pk: PubKey)

source

pub fn remove_pubkey(&self, id: i32)

source

pub fn set_pubkeys(&self, pks: Vec<Pubkey>)

source

pub fn get_pubkeys(&self) -> Vec<PubKey>

source

pub fn add_or_update_user(&self, user: User) -> Result<()>

source

pub fn get_user_by_oidc(&self, oidc_id: &str) -> Option<User>

source

pub fn get_user(&self, user_id: DieselUlid) -> Option<User>

source

pub fn remove_user(&self, user_id: &DieselUlid)

source

pub fn get_resource(&self, res: &Resource) -> Option<Resource>

source

pub fn remove_resource( &self, persistent_resource: Resource, shared_id: DieselUlid )

source

pub fn process_api_resource_update( &self, res: ApiResource, shared_id: DieselUlid, persistent_resource: Resource ) -> Result<()>

source

pub fn process_full_sync(&self, fs_data: FullSyncData) -> Result<()>

source

pub fn traverse_res_path(&self, name: &str) -> Result<Vec<ResPath>>

source

pub fn get_name_path(&self, name: String) -> Result<Vec<(Resource, Resource)>>

Trait Implementations§

source§

impl Debug for Cache

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Cache

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Cache

§

impl Send for Cache

§

impl Sync for Cache

§

impl Unpin for Cache

§

impl UnwindSafe for Cache

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> IntoSql for T

§

fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,

Convert self to an expression for Diesel’s query builder. Read more
§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more