pub struct Channel(_);Implementations§
source§impl Channel
impl Channel
pub fn new( weak_stack: Weak<StackImpl>, tunnel: TunnelGuard, command_tunnel: DatagramTunnelGuard ) -> Self
pub fn ref_count(&self) -> usize
pub fn to_weak(&self) -> WeakChannel
pub fn tunnel(&self) -> &TunnelGuard
pub fn config(&self) -> &Config
pub fn upload( &self, chunk: ChunkId, session_id: TempSeq, piece_type: ChunkCodecDesc, encoder: Box<dyn ChunkEncoder> ) -> BuckyResult<UploadSession>
pub fn download( &self, chunk: ChunkId, source: DownloadSource<DeviceId>, cache: ChunkStreamCache, referer: Option<String>, group_path: Option<String> ) -> BuckyResult<DownloadSession>
pub fn interest(&self, interest: Interest)
sourcepub fn resp_interest(&self, resp: RespInterest)
pub fn resp_interest(&self, resp: RespInterest)
Examples found in repository?
examples/single_source.rs (line 87)
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
async fn on_newly_interest(
&self,
_stack: &Stack,
interest: &Interest,
from: &Channel
) -> BuckyResult<()> {
let resp = RespInterest {
session_id: interest.session_id.clone(),
chunk: interest.chunk.clone(),
err: BuckyErrorCode::NotFound,
redirect: None,
redirect_referer: None,
to: None,
};
from.resp_interest(resp);
Ok(())
}