Skip to content

Commit 4d19d64

Browse files
authored
chore: impl from for GlobalOrLocalHttpCache (#76)
impl from
1 parent 589e9d1 commit 4d19d64

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

rs_lib/src/cache.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,48 @@ pub enum GlobalOrLocalHttpCache<
224224
Local(LocalHttpCacheRc<Sys>),
225225
}
226226

227+
impl<
228+
Sys: FsCreateDirAll
229+
+ FsMetadata
230+
+ FsOpen
231+
+ FsRemoveFile
232+
+ FsRename
233+
+ ThreadSleep
234+
+ SystemRandom
235+
+ SystemTimeNow
236+
+ std::fmt::Debug
237+
+ FsRead
238+
+ Clone
239+
+ MaybeSend
240+
+ MaybeSync,
241+
> From<GlobalHttpCacheRc<Sys>> for GlobalOrLocalHttpCache<Sys>
242+
{
243+
fn from(global: GlobalHttpCacheRc<Sys>) -> Self {
244+
Self::Global(global)
245+
}
246+
}
247+
248+
impl<
249+
Sys: FsCreateDirAll
250+
+ FsMetadata
251+
+ FsOpen
252+
+ FsRemoveFile
253+
+ FsRename
254+
+ ThreadSleep
255+
+ SystemRandom
256+
+ SystemTimeNow
257+
+ std::fmt::Debug
258+
+ FsRead
259+
+ Clone
260+
+ MaybeSend
261+
+ MaybeSync,
262+
> From<LocalHttpCacheRc<Sys>> for GlobalOrLocalHttpCache<Sys>
263+
{
264+
fn from(local: LocalHttpCacheRc<Sys>) -> Self {
265+
Self::Local(local)
266+
}
267+
}
268+
227269
impl<
228270
Sys: FsCreateDirAll
229271
+ FsMetadata

0 commit comments

Comments
 (0)