pub struct RemoteResourceService;Expand description
远端资源服务
提供处理远端资源下载和缓存的静态方法
Implementations§
Source§impl RemoteResourceService
impl RemoteResourceService
Sourcepub fn find_cache(
cache_config: &CacheConfig,
resource: &SignerRemoteResource,
) -> Result<Option<PathBuf>, StorageError>
pub fn find_cache( cache_config: &CacheConfig, resource: &SignerRemoteResource, ) -> Result<Option<PathBuf>, StorageError>
从本地缓存中查询文件
Sourcepub async fn download(
cache_config: &CacheConfig,
resource: &SignerRemoteResource,
) -> Result<PathBuf, StorageError>
pub async fn download( cache_config: &CacheConfig, resource: &SignerRemoteResource, ) -> Result<PathBuf, StorageError>
从远端下载文件到缓存
Auto Trait Implementations§
impl Freeze for RemoteResourceService
impl RefUnwindSafe for RemoteResourceService
impl Send for RemoteResourceService
impl Sync for RemoteResourceService
impl Unpin for RemoteResourceService
impl UnsafeUnpin for RemoteResourceService
impl UnwindSafe for RemoteResourceService
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more