[][src]Enum openrazer::devices::Device

pub enum Device {
    Huntsman(Huntsman),
    Other(GenericDevice),
}

A Razer device, possibly a specific one.

This enum represents some Razer device. It has methods for each capability (e.g. brightness, effects and keyboard layout), but these methods check that the capability is present, because they operate on an unkonwn device. If it is, then a special struct, which controls the capatibily, is returned.

This crate also has types for specific devices, e.g. Razer Hunstman. If the underlying device is known to this crate, it will construct a variant for this speicifc device, e.g. Device::Huntsman instead of Device::Other for yet unknown devices. You can match on this enum and use a type-safer API that knows the device's capabilities, e.g. trying to set DPI for a keyboard will result in a compile-time error.

Variants

Huntsman(Huntsman)

A Razer Huntsman keyboard.

A device unknown to this crate.

Implementations

impl Device[src]

pub fn breath_effect(&self) -> Option<BreathEffect>[src]

Controls the breath effect.

pub fn custom_effect(&self) -> Option<CustomEffect>[src]

Controls the custom effect.

pub fn brightness(&self) -> Option<Brightness>[src]

Controls the device's brightness.

pub fn game_mode(&self) -> Option<GameMode>[src]

Controls the device's Game Mode.

pub fn keyboard_layout(&self) -> Option<KeyboardLayout>[src]

Gets the device's keyboard layout.

pub fn macro_effect(&self) -> Option<MacroEffect>[src]

Controls the device's macro effect.

pub fn macro_mode(&self) -> Option<MacroMode>[src]

Controls the device's Macro Mode.

pub fn matrix_dimensions(&self) -> Option<MatrixDimensions>[src]

Gets the device's matrix dimensions.

pub fn no_effect(&self) -> Option<NoEffect>[src]

Disables any lighting effect.

pub fn reactive_effect(&self) -> Option<ReactiveEffect>[src]

Controls the reactive effect.

pub fn ripple_effect(&self) -> Option<RippleEffect>[src]

Controls the ripple effect.

pub fn spectrum_effect(&self) -> Option<SpectrumEffect>[src]

Sets the spectrum effect.

pub fn starlight_effect(&self) -> Option<StarlightEffect>[src]

Sets the starlight effect.

pub fn static_effect(&self) -> Option<StaticEffect>[src]

Controls the static effect.

pub fn wave_effect(&self) -> Option<WaveEffect>[src]

Controls the wave effect.

Trait Implementations

impl Clone for Device[src]

impl Debug for Device[src]

impl GenericMethods for Device[src]

Auto Trait Implementations

impl !RefUnwindSafe for Device

impl Send for Device

impl Sync for Device

impl Unpin for Device

impl !UnwindSafe for Device

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.