Skip to main content

TomlStorage

Struct TomlStorage 

Source
pub struct TomlStorage { /* private fields */ }

Implementations§

Source§

impl TomlStorage

Source

pub fn new(path: PathBuf) -> TomlStorage

Source

pub fn default_path() -> Result<PathBuf, Error>

Default config path: ~/.config/bookmarks/bookmarks.toml

Source

pub fn cwd_path() -> Option<PathBuf>

Local config path: ./bookmarks.toml in the current working directory.

Source

pub fn with_default_path() -> Result<TomlStorage, Error>

Trait Implementations§

Source§

impl Storage for TomlStorage

Source§

fn load(&self) -> Result<Config, Error>

Load the full config (urls, groups).
Source§

fn save(&self, config: &Config) -> Result<(), Error>

Save the full config, replacing whatever was stored.
Source§

fn init(&self) -> Result<(), Error>

Initialize storage if it doesn’t exist yet.
Source§

fn backend_name(&self) -> &str

Human-readable backend name (“toml”, “database”, etc).
Source§

fn path(&self) -> Option<&Path>

Path to the underlying storage (if file-based).

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.