Skip to main content

Notification

Struct Notification 

Source
pub struct Notification {
    id: u64,
    word: AtomicU64,
    waitq: WaitQueue,
    bound: SpinLock<Option<Arc<Endpoint>>>,
    _charge: Option<IpcCharge>,
}
Expand description

A 64-bit OR-coalescing signal word with an optional endpoint binding.

Fields§

§id: u64§word: AtomicU64§waitq: WaitQueue§bound: SpinLock<Option<Arc<Endpoint>>>§_charge: Option<IpcCharge>

Creator-silo notification count (§12), released with the object.

Implementations§

Source§

impl Notification

Source

pub fn create() -> Arc<Notification> ⓘ

Create an uncharged notification (kernel-internal use).

Source

pub fn create_charged(charge: Option<IpcCharge>) -> Arc<Notification> ⓘ

Create a notification paid for by charge.

Source

pub fn id(&self) -> u64

Internal object id.

Source

pub fn signal(&self, bits: u64) -> Result<(), SyscallError>

Signal bits: OR into the word and raise the bound endpoint’s pending bits. bits is already masked by the caller (handle badge).

Source

pub fn take(&self) -> Option<u64>

Non-blocking read-and-clear (async path); None when no bit is set.

Source

pub fn wait( &self, nonblock: bool, deadline_ns: Option<u64>, ) -> Result<u64, SyscallError>

Wait for non-zero bits, atomically read and clear them.

deadline_ns (absolute, crate::sync::scheduler_clock_ns) bounds the whole wait, including retries after another waiter took the bits.

Source

pub fn bind_arc(&self, ep: Arc<Endpoint>)

Install the endpoint Arc on the notification side.

Source

pub fn unbind_if(&self, endpoint_id: u64)

Clear the binding if it still points at endpoint_id.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.