pub struct DockerConfigAuth { /* private fields */ }Expand description
Docker config.json authentication manager
Implementations§
Source§impl DockerConfigAuth
impl DockerConfigAuth
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load Docker config from the default location (~/.docker/config.json)
§Errors
Returns an error if the home directory cannot be determined or the config file exists but cannot be read or parsed.
Sourcepub fn load_from_path(path: &Path) -> Result<Self>
pub fn load_from_path(path: &Path) -> Result<Self>
Load Docker config from a specific path
§Errors
Returns an error if the file exists but cannot be read or parsed.
Sourcepub fn get_credentials(&self, registry: &str) -> Option<(String, String)>
pub fn get_credentials(&self, registry: &str) -> Option<(String, String)>
Get credentials for a specific registry
Returns (username, password) if credentials are found for the registry. The registry parameter should match the registry hostname (e.g., “docker.io”, “ghcr.io”).
Sourcepub fn registries(&self) -> Vec<String>
pub fn registries(&self) -> Vec<String>
Get all configured registry hostnames
Trait Implementations§
Source§impl Clone for DockerConfigAuth
impl Clone for DockerConfigAuth
Source§fn clone(&self) -> DockerConfigAuth
fn clone(&self) -> DockerConfigAuth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DockerConfigAuth
impl Debug for DockerConfigAuth
Source§impl<'de> Deserialize<'de> for DockerConfigAuth
impl<'de> Deserialize<'de> for DockerConfigAuth
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
Auto Trait Implementations§
impl Freeze for DockerConfigAuth
impl RefUnwindSafe for DockerConfigAuth
impl Send for DockerConfigAuth
impl Sync for DockerConfigAuth
impl Unpin for DockerConfigAuth
impl UnsafeUnpin for DockerConfigAuth
impl UnwindSafe for DockerConfigAuth
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