Skip to main content

PendingEvents

Struct PendingEvents 

Source
pub struct PendingEvents<T> {
    buf: VecDeque<T>,
}
Expand description

アプリへまだ渡せていない入力の控え。OS 側だけが持つ(錠は要らない)。

Fields§

§buf: VecDeque<T>

Implementations§

Source§

impl<T> PendingEvents<T>

Source

pub const fn new() -> Self

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn push(&mut self, ev: T)

末尾に積む(キー・マウス・タブの操作)。

Source

pub fn push_replacing(&mut self, ev: T, same_kind: impl Fn(&T) -> bool)

置き換え型の入力を積む。控えの中の同じ種類の物を外してから末尾に置く。

Source

pub fn flush_into( &mut self, dst: &mut Vec<T>, same_kind: impl Fn(&T) -> bool, ) -> usize

控えを全部、渡す先のキュー dst(錠を取れたアプリのキュー)の末尾へ移す。 控えに置き換え型が入っていれば、dst に残っている同じ種類の古い物を先に外す。 移した数を返す。

Source

pub fn clear(&mut self)

控えを捨てる(アプリが止まって、渡す先がもう無いとき)。

Trait Implementations§

Source§

impl<T> Default for PendingEvents<T>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> Freeze for PendingEvents<T>

§

impl<T> RefUnwindSafe for PendingEvents<T>
where T: RefUnwindSafe,

§

impl<T> Send for PendingEvents<T>
where T: Send,

§

impl<T> Sync for PendingEvents<T>
where T: Sync,

§

impl<T> Unpin for PendingEvents<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for PendingEvents<T>

§

impl<T> UnwindSafe for PendingEvents<T>
where T: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.