Struct iroh_bitswap::peer_task_queue::Task
source · pub struct Task<T: Topic, D: Data> {
pub topic: T,
pub priority: isize,
pub work: usize,
pub data: D,
}Expand description
A single task to be executed.
Fields§
§topic: TThe topic of the task.
priority: isizeThe priority of the task
work: usizeThe size of the task
- peers with most active work are deprioritzed
- peers with most pending work are prioritized
data: DAssociated data.
Trait Implementations§
source§impl<T: PartialEq + Topic, D: PartialEq + Data> PartialEq<Task<T, D>> for Task<T, D>
impl<T: PartialEq + Topic, D: PartialEq + Data> PartialEq<Task<T, D>> for Task<T, D>
impl<T: Eq + Topic, D: Eq + Data> Eq for Task<T, D>
impl<T: Topic, D: Data> StructuralEq for Task<T, D>
impl<T: Topic, D: Data> StructuralPartialEq for Task<T, D>
Auto Trait Implementations§
impl<T, D> RefUnwindSafe for Task<T, D>where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, D> Send for Task<T, D>where
T: Send,
impl<T, D> Sync for Task<T, D>where
D: Sync,
T: Sync,
impl<T, D> Unpin for Task<T, D>where
D: Unpin,
T: Unpin,
impl<T, D> UnwindSafe for Task<T, D>where
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request