pub struct Config<'a> {
pub package: &'a str,
pub version: &'a str,
pub repo: &'a [&'static str],
pub download_dir: Option<&'a str>,
pub timeout: Option<Duration>,
}Expand description
配置结构体,用于指定要获取的包信息
Fields§
§package: &'a str包名
version: &'a str期望的版本号(semver 格式)
repo: &'a [&'static str]仓库 URL 列表,按优先级排序
download_dir: Option<&'a str>下载文件夹地址,None 表示使用系统临时目录
timeout: Option<Duration>超时时间(秒),None 表示使用默认的 30 秒
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Config<'a>
impl<'a> RefUnwindSafe for Config<'a>
impl<'a> Send for Config<'a>
impl<'a> Sync for Config<'a>
impl<'a> Unpin for Config<'a>
impl<'a> UnsafeUnpin for Config<'a>
impl<'a> UnwindSafe for Config<'a>
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