Enum brane_tsk::docker::ImageSource
source · pub enum ImageSource {
Path(PathBuf),
Registry(String),
}
Expand description
Defines the source of an image (either a file or from a repo).
Variants§
Path(PathBuf)
It’s a file, and this is the path to load.
Registry(String)
It’s in a remote registry, and this is it.
Implementations§
source§impl ImageSource
impl ImageSource
sourcepub fn is_path(&self) -> bool
pub fn is_path(&self) -> bool
Checks whether this source is a file.
§Returns
True if we are ImageSource::Path
, or false otherwise.
sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Provides access to the internal path.
§Returns
A reference to the internal PathBuf
.
§Panics
This function panics if we are not the ImageSource::Path
we assumed we were.
sourcepub fn path_mut(&mut self) -> &mut PathBuf
pub fn path_mut(&mut self) -> &mut PathBuf
Provides mutable access to the internal path.
§Returns
A mutable reference to the internal PathBuf
.
§Panics
This function panics if we are not the ImageSource::Path
we assumed we were.
sourcepub fn into_path(self) -> PathBuf
pub fn into_path(self) -> PathBuf
Takes ownership of the internal path.
§Returns
The internal PathBuf
.
§Panics
This function panics if we are not the ImageSource::Path
we assumed we were.
sourcepub fn is_registry(&self) -> bool
pub fn is_registry(&self) -> bool
Checks whether this source is a registry.
§Returns
True if we are ImageSource::Registry
, or false otherwise.
sourcepub fn registry(&self) -> &str
pub fn registry(&self) -> &str
Provides access to the internal address.
§Returns
A reference to the internal String
address.
§Panics
This function panics if we are not the ImageSource::Registry
we assumed we were.
sourcepub fn registry_mut(&mut self) -> &mut String
pub fn registry_mut(&mut self) -> &mut String
Provides mutable access to the internal address.
§Returns
A mutable reference to the internal String
address.
§Panics
This function panics if we are not the ImageSource::Registry
we assumed we were.
sourcepub fn into_registry(self) -> String
pub fn into_registry(self) -> String
Takes ownership of the internal address.
§Returns
The internal String
address.
§Panics
This function panics if we are not the ImageSource::Registry
we assumed we were.
sourcepub fn serialize(&self) -> ImageSourceSerializer<'_>
pub fn serialize(&self) -> ImageSourceSerializer<'_>
Returns a formatter for the ImageSource that can serialize it in a deterministic manner. This method should be preferred if ImageSource::from_str()
should read it.
Trait Implementations§
source§impl AsRef<ImageSource> for ImageSource
impl AsRef<ImageSource> for ImageSource
source§impl Clone for ImageSource
impl Clone for ImageSource
source§fn clone(&self) -> ImageSource
fn clone(&self) -> ImageSource
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ImageSource
impl Debug for ImageSource
source§impl<'de> Deserialize<'de> for ImageSource
impl<'de> Deserialize<'de> for ImageSource
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>,
source§impl Display for ImageSource
impl Display for ImageSource
source§impl EnumDebug for ImageSource
impl EnumDebug for ImageSource
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<&ImageSource> for ImageSource
impl From<&ImageSource> for ImageSource
source§fn from(value: &ImageSource) -> Self
fn from(value: &ImageSource) -> Self
source§impl From<&mut ImageSource> for ImageSource
impl From<&mut ImageSource> for ImageSource
source§fn from(value: &mut ImageSource) -> Self
fn from(value: &mut ImageSource) -> Self
source§impl FromStr for ImageSource
impl FromStr for ImageSource
Auto Trait Implementations§
impl Freeze for ImageSource
impl RefUnwindSafe for ImageSource
impl Send for ImageSource
impl Sync for ImageSource
impl Unpin for ImageSource
impl UnwindSafe for ImageSource
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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