pub struct PollerOptions {
pub capacity: usize,
pub overflow: PollerOverflow,
pub block_timeout: Option<Duration>,
}Expand description
Options for Graph::add_poller_with_options.
Fields§
§capacity: usize§overflow: PollerOverflow§block_timeout: Option<Duration>Block 溢出策略下,等宿主腾出一个槽位的上界。None 表示无上界,
仅适用于宿主确定会在另一个线程持续排水的场景。
Implementations§
Source§impl PollerOptions
impl PollerOptions
Sourcepub fn new(capacity: usize, overflow: PollerOverflow) -> Self
pub fn new(capacity: usize, overflow: PollerOverflow) -> Self
Block 默认带 5 秒上界;有损策略下该字段无意义。
Sourcepub fn with_block_timeout(self, timeout: Option<Duration>) -> Self
pub fn with_block_timeout(self, timeout: Option<Duration>) -> Self
覆盖 Block 的等待上界。
Trait Implementations§
Source§impl Clone for PollerOptions
impl Clone for PollerOptions
Source§fn clone(&self) -> PollerOptions
fn clone(&self) -> PollerOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PollerOptions
Source§impl Debug for PollerOptions
impl Debug for PollerOptions
impl Eq for PollerOptions
Source§impl PartialEq for PollerOptions
impl PartialEq for PollerOptions
impl StructuralPartialEq for PollerOptions
Auto Trait Implementations§
impl Freeze for PollerOptions
impl RefUnwindSafe for PollerOptions
impl Send for PollerOptions
impl Sync for PollerOptions
impl Unpin for PollerOptions
impl UnsafeUnpin for PollerOptions
impl UnwindSafe for PollerOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.