Skip to main content

Signal

Enum Signal 

Source
pub enum Signal {
Show 18 variants KeyDown { keyboard: Address, char: u32, code: u32, player: String, }, KeyUp { keyboard: Address, char: u32, code: u32, player: String, }, Clipboard { keyboard: Address, text: String, player: String, }, Touch { screen: Address, x: Number, y: Number, button: i64, player: String, }, Drag { screen: Address, x: Number, y: Number, button: i64, player: String, }, Drop { screen: Address, x: Number, y: Number, button: i64, player: String, }, Scroll { screen: Address, x: Number, y: Number, direction: i64, player: String, }, Walk { screen: Address, x: Number, y: Number, player: Option<String>, }, ComponentAdded { address: Address, kind: String, }, ComponentRemoved { address: Address, kind: String, }, ComponentAvailable { kind: String, }, ComponentUnavailable { kind: String, }, RedstoneChanged { address: Address, side: i64, old: i64, new: i64, color: Option<i64>, }, Motion { address: Address, x: Number, y: Number, z: Number, entity: Option<String>, }, ModemMessage { receiver: Address, sender: Address, port: i64, distance: Number, data: Vec<Value>, }, InventoryChanged { slot: i64, }, PatternRequest { provider: Address, job: i64, pattern: i64, }, Other { name: String, args: Vec<Value>, },
}
Expand description

A signal, decoded when it is one of OpenComputers’ standard ones.

Variants§

§

KeyDown

Fields

§keyboard: Address
§char: u32
§code: u32
§player: String
§

KeyUp

Fields

§keyboard: Address
§char: u32
§code: u32
§player: String
§

Clipboard

Fields

§keyboard: Address
§text: String
§player: String
§

Touch

Fields

§screen: Address
§button: i64
§player: String
§

Drag

Fields

§screen: Address
§button: i64
§player: String
§

Drop

Fields

§screen: Address
§button: i64
§player: String
§

Scroll

Fields

§screen: Address
§direction: i64
§player: String
§

Walk

Fields

§screen: Address
§player: Option<String>
§

ComponentAdded

Fields

§address: Address
§kind: String
§

ComponentRemoved

Fields

§address: Address
§kind: String
§

ComponentAvailable

Fields

§kind: String
§

ComponentUnavailable

Fields

§kind: String
§

RedstoneChanged

Fields

§address: Address
§side: i64
§old: i64
§new: i64
§color: Option<i64>
§

Motion

Fields

§address: Address
§entity: Option<String>
§

ModemMessage

Fields

§receiver: Address
§sender: Address
§port: i64
§distance: Number
§data: Vec<Value>
§

InventoryChanged

Fields

§slot: i64
§

PatternRequest

A Computer Pattern Provider (AE2) was handed the inputs for a job; see crate::pattern_provider. pattern is the pattern’s index, from 1.

Fields

§provider: Address
§job: i64
§pattern: i64
§

Other

Anything else, as sent.

Fields

§name: String
§args: Vec<Value>

Implementations§

Source§

impl Signal

Source

pub fn parse(name: String, args: Vec<Value>) -> Signal

Decodes [name, args...].

Source

pub fn key_down(&self) -> Option<(char, u32)>

The typed key press, if this is one: (char, code).

Trait Implementations§

Source§

impl Clone for Signal

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Signal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Signal

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Signal

Auto Trait Implementations§

§

impl Forget for Signal

§

impl Freeze for Signal

§

impl Move for Signal

§

impl RefUnwindSafe for Signal

§

impl Send for Signal

§

impl Sync for Signal

§

impl Unpin for Signal

§

impl UnsafeUnpin for Signal

§

impl UnwindSafe for Signal

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.