pub enum IndexLocation {
Local(PathBuf),
Remote(String),
}
Expand description
Defines an enum that either defines a local path to fetch packages / datasets from, or a remote location to fetch packages / datasets from.
Variants§
Implementations§
Source§impl IndexLocation
impl IndexLocation
Sourcepub fn serialize(&self) -> IndexLocationSerializer<'_>
pub fn serialize(&self) -> IndexLocationSerializer<'_>
Returns a formatter for the IndexLocation that writes it in an unambigious, serialized way.
Sourcepub fn local(&self) -> &PathBuf
pub fn local(&self) -> &PathBuf
Returns the path in this IndexLocation as if it is a Local location.
§Panics
This function will panic if self
is not a Self::Local
.
Sourcepub fn local_mut(&mut self) -> &mut PathBuf
pub fn local_mut(&mut self) -> &mut PathBuf
Returns a mutable path in this IndexLocation as if it is a Local location.
§Panics
This function will panic if self
is not a Self::Local
.
Sourcepub fn into_local(self) -> PathBuf
pub fn into_local(self) -> PathBuf
Consumes this IndexLocation into a local path as if it is a Local location.
§Panics
This function will panic if self
is not a Self::Local
.
Sourcepub fn remote(&self) -> &String
pub fn remote(&self) -> &String
Returns the address in this IndexLocation as if it is a Remote location.
§Panics
This function will panic if self
is not a Self::Remote
.
Sourcepub fn remote_mut(&mut self) -> &mut String
pub fn remote_mut(&mut self) -> &mut String
Returns a mutable address in this IndexLocation as if it is a Remote location.
§Panics
This function will panic if self
is not a Self::Remote
.
Sourcepub fn into_remote(self) -> String
pub fn into_remote(self) -> String
Consumes this IndexLocation into a remote address as if it is a Remote location.
§Panics
This function will panic if self
is not a Self::Remote
.
Trait Implementations§
Source§impl AsRef<IndexLocation> for IndexLocation
impl AsRef<IndexLocation> for IndexLocation
Source§impl Clone for IndexLocation
impl Clone for IndexLocation
Source§fn clone(&self) -> IndexLocation
fn clone(&self) -> IndexLocation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for IndexLocation
impl Debug for IndexLocation
Source§impl Display for IndexLocation
impl Display for IndexLocation
Source§impl EnumDebug for IndexLocation
impl EnumDebug for IndexLocation
Source§fn type_name() -> &'static str
fn type_name() -> &'static str
Source§fn variant_names() -> &'static [&'static str]
fn variant_names() -> &'static [&'static str]
Source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Source§fn variant(&self) -> EnumDebugFormatter<'_, Self>
fn variant(&self) -> EnumDebugFormatter<'_, Self>
Source§impl From<&IndexLocation> for IndexLocation
impl From<&IndexLocation> for IndexLocation
Source§fn from(value: &IndexLocation) -> Self
fn from(value: &IndexLocation) -> Self
Source§impl From<&mut IndexLocation> for IndexLocation
impl From<&mut IndexLocation> for IndexLocation
Source§fn from(value: &mut IndexLocation) -> Self
fn from(value: &mut IndexLocation) -> Self
Source§impl FromStr for IndexLocation
impl FromStr for IndexLocation
Source§impl Hash for IndexLocation
impl Hash for IndexLocation
Source§impl PartialEq for IndexLocation
impl PartialEq for IndexLocation
impl Eq for IndexLocation
impl StructuralPartialEq for IndexLocation
Auto Trait Implementations§
impl Freeze for IndexLocation
impl RefUnwindSafe for IndexLocation
impl Send for IndexLocation
impl Sync for IndexLocation
impl Unpin for IndexLocation
impl UnwindSafe for IndexLocation
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request