pub struct Config {
pub urls: HashMap<String, UrlEntry>,
pub groups: HashMap<String, Vec<String>>,
}Fields§
§urls: HashMap<String, UrlEntry>§groups: HashMap<String, Vec<String>>Implementations§
Source§impl Config
impl Config
Sourcepub fn resolve(&self, name: &str) -> Option<&str>
pub fn resolve(&self, name: &str) -> Option<&str>
Resolve a name (url name or alias) to a URL string.
pub fn validate(&self) -> Vec<String>
Sourcepub fn rename_url(&mut self, old: &str, new: &str) -> Result<(), Error>
pub fn rename_url(&mut self, old: &str, new: &str) -> Result<(), Error>
Rename a url key and cascade to group entries that reference it by name.
Sourcepub fn rename_alias(&mut self, old: &str, new: &str) -> Result<(), Error>
pub fn rename_alias(&mut self, old: &str, new: &str) -> Result<(), Error>
Rename an alias and cascade to group entries.
Sourcepub fn delete_url(&mut self, name: &str) -> Result<(), Error>
pub fn delete_url(&mut self, name: &str) -> Result<(), Error>
Delete a url and clean up group references to it and its aliases.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Config
impl Serialize for Config
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more