pub struct LocalRegistryBuilder { /* private fields */ }
Available on crate feature
local
only.Expand description
Allows the building of a local registry from a [RemoteGitIndex
] or [RemoteSparseIndex
]
Implementations§
Source§impl LocalRegistryBuilder
impl LocalRegistryBuilder
Sourcepub fn create(path: PathBuf) -> Result<Self, Error>
pub fn create(path: PathBuf) -> Result<Self, Error>
Creates a builder for the specified directory.
The directory is required to be empty, but it will be created if it doesn’t exist
Sourcepub fn insert(
&self,
krate: &IndexKrate,
krates: &[ValidKrate<'_>],
) -> Result<u64, Error>
pub fn insert( &self, krate: &IndexKrate, krates: &[ValidKrate<'_>], ) -> Result<u64, Error>
Inserts the specified crate index entry and one or more crates files into the registry
This will fail if the specified crate is already located in the index, it is your responsibility to insert the crate and all the versions you want only once
Sourcepub fn finalize(self, validate: bool) -> Result<LocalRegistry, Error>
pub fn finalize(self, validate: bool) -> Result<LocalRegistry, Error>
Consumes the builder and opens a LocalRegistry
Auto Trait Implementations§
impl Freeze for LocalRegistryBuilder
impl RefUnwindSafe for LocalRegistryBuilder
impl Send for LocalRegistryBuilder
impl Sync for LocalRegistryBuilder
impl Unpin for LocalRegistryBuilder
impl UnwindSafe for LocalRegistryBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more