[−][src]Struct yocto_client::Store
Represents a key-value store
Methods
impl Store
[src]
pub fn new(connection: &str) -> Result<Store, Box<dyn Error>>
[src]
Returns a new yocto store
Arguments
connection
- A string slice that holds the endpoint of the yocto server
pub fn get(&self, key: &str) -> Result<Option<String>, Box<dyn Error>>
[src]
Locates the given key inside the database and returns an Ok with the corresponding value if existing or an None if not.
Arguments
key
- A string slice that holds the key to look up
pub fn insert(
&self,
key: &str,
value: &str
) -> Result<Option<String>, Box<dyn Error>>
[src]
&self,
key: &str,
value: &str
) -> Result<Option<String>, Box<dyn Error>>
Inserts a value for a specified key. Returns the old value if existent.
Arguments
key
- A string slice that holds the key to insert the value forvalue
- The value to insert
pub fn remove(&self, key: &str) -> Result<Option<String>, Box<dyn Error>>
[src]
Removes the value corresponding to a key. Returns Err if key is not found.
Arguments
key
- A string slice that holds the key to delete the value for
pub fn clear(&self) -> Result<Option<String>, Box<dyn Error>>
[src]
Removes all key-value pairs from the database
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?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>,