pub struct Blobs<S> { /* private fields */ }
Available on crate feature
net_protocol
only.Expand description
Blobs protocol handler.
Implementations§
Source§impl<S: Store> Blobs<S>
impl<S: Store> Blobs<S>
Sourcepub fn new(
store: S,
rt: LocalPoolHandle,
events: EventSender,
downloader: Downloader,
endpoint: Endpoint,
) -> Self
pub fn new( store: S, rt: LocalPoolHandle, events: EventSender, downloader: Downloader, endpoint: Endpoint, ) -> Self
Create a new Blobs protocol handler.
This is the low-level constructor that allows you to customize
everything. If you don’t need that, consider using Blobs::builder
.
Sourcepub fn events(&self) -> &EventSender
pub fn events(&self) -> &EventSender
Get the event sender.
Sourcepub fn rt(&self) -> &LocalPoolHandle
pub fn rt(&self) -> &LocalPoolHandle
Get the local pool handle.
Sourcepub fn downloader(&self) -> &Downloader
pub fn downloader(&self) -> &Downloader
Get the downloader.
Sourcepub fn add_protected(&self, cb: ProtectCb) -> Result<()>
pub fn add_protected(&self, cb: ProtectCb) -> Result<()>
Add a callback that will be called before the garbage collector runs.
This can only be called before the garbage collector has started, otherwise it will return an error.
Source§impl<D: Store> Blobs<D>
impl<D: Store> Blobs<D>
Sourcepub fn client(&self) -> &MemClient
Available on crate feature rpc
only.
pub fn client(&self) -> &MemClient
rpc
only.Get a client for the blobs protocol
Sourcepub async fn handle_rpc_request<C>(
self,
msg: Request,
chan: RpcChannel<RpcService, C>,
) -> Result<(), RpcServerError<C>>where
C: ChannelTypes<RpcService>,
Available on crate feature rpc
only.
pub async fn handle_rpc_request<C>(
self,
msg: Request,
chan: RpcChannel<RpcService, C>,
) -> Result<(), RpcServerError<C>>where
C: ChannelTypes<RpcService>,
rpc
only.Handle an RPC request
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Blobs<S>
impl<S> !RefUnwindSafe for Blobs<S>
impl<S> Send for Blobs<S>
impl<S> Sync for Blobs<S>
impl<S> Unpin for Blobs<S>
impl<S> !UnwindSafe for Blobs<S>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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