Skip to main content

DroneAccessStore

Trait DroneAccessStore 

Source
pub trait DroneAccessStore {
    // Required methods
    fn access_get(&self, drone_id: &str) -> Result<DroneAccess, StoreError>;
    fn access_set_owner(
        &self,
        drone_id: &str,
        agent: &str,
        now_ms: i64,
    ) -> Result<(), StoreError>;
    fn access_set_agents(
        &self,
        drone_id: &str,
        agents: &[String],
        by: &str,
        now_ms: i64,
    ) -> Result<(), StoreError>;
    fn access_delete_for(&self, drone_id: &str) -> Result<usize, StoreError>;
}

Required Methods§

Source

fn access_get(&self, drone_id: &str) -> Result<DroneAccess, StoreError>

The owner and the given agents of drone_id.

Source

fn access_set_owner( &self, drone_id: &str, agent: &str, now_ms: i64, ) -> Result<(), StoreError>

Make agent the owner of a drone that has none. Does nothing when it has one.

Source

fn access_set_agents( &self, drone_id: &str, agents: &[String], by: &str, now_ms: i64, ) -> Result<(), StoreError>

Replace the agents the drone was given to with agents, recorded as set by by.

Source

fn access_delete_for(&self, drone_id: &str) -> Result<usize, StoreError>

Forget everything about drone_id (it was deleted).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DroneAccessStore for Store

Source§

fn access_get(&self, drone_id: &str) -> Result<DroneAccess, StoreError>

Source§

fn access_set_owner( &self, drone_id: &str, agent: &str, now_ms: i64, ) -> Result<(), StoreError>

Source§

fn access_set_agents( &self, drone_id: &str, agents: &[String], by: &str, now_ms: i64, ) -> Result<(), StoreError>

Source§

fn access_delete_for(&self, drone_id: &str) -> Result<usize, StoreError>

Implementors§