pub struct Lane {
pub id: LaneId,
pub name: String,
pub budget: Budget,
pub pending: u32,
pub completed: u64,
pub channels: BTreeSet<u64>,
pub caps: BTreeSet<u128>,
pub closed: bool,
pub ready: VecDeque<u64>,
}Expand description
A lane’s state.
Fields§
§id: LaneIdKernel-assigned identifier.
name: StringThe name the caller chose.
budget: BudgetThe lane’s own call and byte ceiling.
pending: u32Calls issued by this lane that have not completed.
completed: u64Completed calls.
channels: BTreeSet<u64>Channels this lane is subscribed to.
caps: BTreeSet<u128>Capabilities minted for this lane.
closed: boolTrue once the lane has been destroyed; further calls are refused.
ready: VecDeque<u64>Per-lane ready queue of job ids.
Implementations§
Source§impl Lane
impl Lane
Sourcepub fn new(id: LaneId, name: impl Into<String>, budget: Budget) -> Self
pub fn new(id: LaneId, name: impl Into<String>, budget: Budget) -> Self
Create an open lane with its own budget.
Sourcepub fn attenuate(&mut self, budget: Budget) -> Result<()>
pub fn attenuate(&mut self, budget: Budget) -> Result<()>
Attenuate a lane’s budget; refuses widening.
Sourcepub fn has_capacity(&self) -> bool
pub fn has_capacity(&self) -> bool
Whether the lane may issue another call under its budget.
Pending calls count: queueing a thousand calls before run() must not
let a lane outspend its grant.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lane
impl RefUnwindSafe for Lane
impl Send for Lane
impl Sync for Lane
impl Unpin for Lane
impl UnsafeUnpin for Lane
impl UnwindSafe for Lane
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