Struct cyfs_bdt::utils::SampleDownloadContext
source · pub struct SampleDownloadContext(_);Implementations§
source§impl SampleDownloadContext
impl SampleDownloadContext
pub fn ptr_eq(&self, other: &Self) -> bool
pub fn new(referer: String) -> Self
sourcepub fn desc_streams(referer: String, remotes: Vec<DeviceDesc>) -> Self
pub fn desc_streams(referer: String, remotes: Vec<DeviceDesc>) -> Self
Examples found in repository?
examples/upload_download.rs (line 96)
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
async fn on_newly_interest(
&self,
stack: &Stack,
interest: &Interest,
from: &Channel
) -> BuckyResult<()> {
let (_, reader) = download_chunk(
stack,
interest.chunk.clone(),
None,
SampleDownloadContext::desc_streams("".to_owned(), vec![self.src_dev.desc().clone()]),
).await.unwrap();
{
let store = self.store.clone();
let chunk = interest.chunk.clone();
task::spawn(async move {
store.write_chunk(&chunk, reader).await.unwrap();
});
}
self.default.on_newly_interest(stack, interest, from).await
}pub async fn id_streams( stack: &Stack, referer: String, remotes: &[DeviceId] ) -> BuckyResult<Self>
pub fn add_source(&self, source: DownloadSource<DeviceDesc>)
Trait Implementations§
source§impl Clone for SampleDownloadContext
impl Clone for SampleDownloadContext
source§fn clone(&self) -> SampleDownloadContext
fn clone(&self) -> SampleDownloadContext
Returns a copy 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 more