Struct axsignal::SignalSet

source ·
pub struct SignalSet {
    pub mask: usize,
    pub pending: usize,
}
Expand description

接受信号的结构,每一个进程都有一个

Fields§

§mask: usize

信号掩码

§pending: usize

未决信号集

Implementations§

source§

impl SignalSet

source

pub fn new() -> Self

新建处理模块

source

pub fn clear(&mut self)

清空信号处理模块

source

pub fn find_signal(&self) -> Option<usize>

查询是否有未决信号,若有则返回对应编号

但是不会修改原有信号集

source

pub fn get_one_signal(&mut self) -> Option<usize>

查询当前是否有未决信号

若有则返回信号编号最低的一个,,并且修改原有信号集

source

pub fn try_add_signal(&mut self, sig_num: usize)

尝试添加一个bit作为信号

若当前信号已经加入到未决信号集中,则不作处理

若信号在掩码中,则仍然加入,但是可能不会触发

Trait Implementations§

source§

impl Clone for SignalSet

source§

fn clone(&self) -> SignalSet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for SignalSet

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for SignalSet

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
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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.