pub struct Registry {
pub hosts: Vec<Host>,
}Fields§
§hosts: Vec<Host>Implementations§
Source§impl Registry
impl Registry
Sourcepub fn load(path: &Path) -> Result<Registry>
pub fn load(path: &Path) -> Result<Registry>
Load the registry from path. A missing file is an empty registry,
not an error — nothing has been wired up yet.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Write the registry to path, creating parent directories as needed.
Hosts are written sorted by name for stable diffs.
Sourcepub fn upsert(&mut self, host: Host)
pub fn upsert(&mut self, host: Host)
Insert host, replacing any existing entry with the same name.
Sourcepub fn remove(&mut self, name: &str) -> bool
pub fn remove(&mut self, name: &str) -> bool
Remove the host named name. Returns true if a host was removed.
pub fn list(&self) -> &[Host]
Sourcepub fn mirror_host(&self) -> Option<&Host>
pub fn mirror_host(&self) -> Option<&Host>
The single host currently designated as the GitHub mirror, if any.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Registry
impl<'de> Deserialize<'de> for Registry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Registry
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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