pub type FileSystemClient = Client<FileSystemRegistryStorage, FileSystemContentStorage, FileSystemNamespaceMapStorage>;
Expand description
A Warg registry client that uses the local file system to store package logs and content.
Aliased Type§
pub struct FileSystemClient { /* private fields */ }
Implementations§
Source§impl FileSystemClient
impl FileSystemClient
Sourcepub async fn try_new_with_config(
registry: Option<&str>,
config: &Config,
auth_token: Option<Secret<String>>,
) -> Result<StorageLockResult<Self>, ClientError>
pub async fn try_new_with_config( registry: Option<&str>, config: &Config, auth_token: Option<Secret<String>>, ) -> Result<StorageLockResult<Self>, ClientError>
Attempts to create a client for the given registry URL.
If the URL is None
, the home registry URL is used; if there is no home registry
URL, an error is returned.
If a lock cannot be acquired for a storage directory, then
NewClientResult::Blocked
is returned with the path to the
directory that could not be locked.
Sourcepub async fn try_new_with_default_config(
url: Option<&str>,
) -> Result<StorageLockResult<Self>, ClientError>
pub async fn try_new_with_default_config( url: Option<&str>, ) -> Result<StorageLockResult<Self>, ClientError>
Attempts to create a client for the given registry URL.
If the URL is None
, the home registry URL is used; if there is no home registry
URL, an error is returned.
If a lock cannot be acquired for a storage directory, then
NewClientResult::Blocked
is returned with the path to the
directory that could not be locked.
Same as calling try_new_with_config
with
Config::from_default_file()?.unwrap_or_default()
.
Sourcepub async fn new_with_config(
registry: Option<&str>,
config: &Config,
auth_token: Option<Secret<String>>,
) -> Result<Self, ClientError>
pub async fn new_with_config( registry: Option<&str>, config: &Config, auth_token: Option<Secret<String>>, ) -> Result<Self, ClientError>
Creates a client for the given registry URL.
If the URL is None
, the home registry URL is used; if there is no home registry
URL, an error is returned.
This method blocks if storage locks cannot be acquired.
Sourcepub async fn new_with_default_config(
url: Option<&str>,
) -> Result<Self, ClientError>
pub async fn new_with_default_config( url: Option<&str>, ) -> Result<Self, ClientError>
Creates a client for the given registry URL.
If the URL is None
, the home registry URL is used; if there is no home registry
URL, an error is returned.
This method blocks if storage locks cannot be acquired.
Same as calling new_with_config
with
Config::from_default_file()?.unwrap_or_default()
.