pub struct Blobs { /* private fields */ }
Expand description
A protocol handler for the blobs protocol.
Implementations§
Source§impl Blobs
impl Blobs
pub fn new( store: &Store, endpoint: Endpoint, events: Option<Sender<Event>>, ) -> Self
pub fn store(&self) -> &Store
pub fn endpoint(&self) -> &Endpoint
Sourcepub async fn ticket(
&self,
content: impl Into<HashAndFormat>,
) -> Result<BlobTicket>
pub async fn ticket( &self, content: impl Into<HashAndFormat>, ) -> Result<BlobTicket>
Create a ticket for content on this node.
Note that this does not check whether the content is partially or fully available. It is just a convenience method to create a ticket from content and the address of this node.
Trait Implementations§
Source§impl ProtocolHandler for Blobs
impl ProtocolHandler for Blobs
Source§fn accept(
&self,
conn: Connection,
) -> impl Future<Output = Result<(), AcceptError>> + Send
fn accept( &self, conn: Connection, ) -> impl Future<Output = Result<(), AcceptError>> + Send
Handle an incoming connection. Read more
Source§fn shutdown(&self) -> impl Future<Output = ()> + Send
fn shutdown(&self) -> impl Future<Output = ()> + Send
Called when the router shuts down. Read more
Source§fn on_connecting(
&self,
connecting: Connecting,
) -> impl Future<Output = Result<Connection, AcceptError>> + Send
fn on_connecting( &self, connecting: Connecting, ) -> impl Future<Output = Result<Connection, AcceptError>> + Send
Optional interception point to handle the
Connecting
state. Read moreAuto Trait Implementations§
impl Freeze for Blobs
impl !RefUnwindSafe for Blobs
impl Send for Blobs
impl Sync for Blobs
impl Unpin for Blobs
impl !UnwindSafe for Blobs
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