pub struct Index { /* private fields */ }Expand description
The registry index, read over the network.
Implementations§
Source§impl Index
impl Index
Sourcepub fn new() -> Self
pub fn new() -> Self
The public index.
The offline variable is the host saying the network is not there, which is a stronger statement than a flag nobody passed. A read that would otherwise fail slowly at a name it cannot resolve refuses at once instead.
Sourcepub const fn offline(self, offline: bool) -> Self
pub const fn offline(self, offline: bool) -> Self
Refuse every read, for a caller that declared itself offline.
Sourcepub fn with_root(self, root: &str) -> Self
pub fn with_root(self, root: &str) -> Self
Read another index root, for a test that serves its own.
Sourcepub fn latest_version(&self) -> Result<Version, AppError>
pub fn latest_version(&self) -> Result<Version, AppError>
The newest stable release the registry serves.
§Errors
AppError::Refused when the caller is offline, when the index
cannot be read, or when it lists no stable version.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
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