[−][src]Struct hap::db::Database
Database
is a wrapper type around a boxed implementor of the Storage
trait.
Methods
impl Database
[src]
pub fn new(storage: Box<dyn Storage + Send>) -> Database
[src]
Creates a new Database
.
pub fn new_with_file_storage(dir: &str) -> Result<Database, Error>
[src]
Creates a new Database
with a FileStorage
as its Storage
.
pub fn get_bytes(&self, key: &str) -> Result<Vec<u8>, Error>
[src]
Returns the stored value for a given key as a Vec<u8>
.
pub fn set_bytes(&self, key: &str, value: Vec<u8>) -> Result<(), Error>
[src]
Stores a given Vec<u8>
as the value for a given key.
pub fn get_device(&self) -> Result<Device, Error>
[src]
Returns the stored Device
.
pub fn set_device(&self, device: &Device) -> Result<(), Error>
[src]
Stores the Device
.
pub fn get_pairing(&self, id: Uuid) -> Result<Pairing, Error>
[src]
Returns the stored Pairing
for a given Uuid
.
pub fn set_pairing(&self, pairing: &Pairing) -> Result<(), Error>
[src]
Stores a given Pairing
.
pub fn delete_pairing(&self, id: &Uuid) -> Result<(), Error>
[src]
Deletes the stored Pairing
for a given Uuid
.
pub fn list_pairings(&self) -> Result<Vec<Pairing>, Error>
[src]
Returns a Vec
with all stored pairings.
pub fn count_pairings(&self) -> Result<usize, Error>
[src]
Returns the number of stored pairings.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self