# Struct alsa::seq::Event [−] [src]

    pub struct Event<'a>(_, _, _);

snd_seq_event_t wrapper

Fields of the event is not directly exposed. Instead call `Event::new` to set data (which can be, e g, an EvNote). Use `get_type` and `get_data` to retreive data.

The lifetime parameter refers to the lifetime of an associated external buffer that might be used for variable-length messages (e.g. SysEx).

## Methods

### `impl<'a> Event<'a>`
[src]

#### `fn new<D: EventData>(t: EventType, data: &D) -> Event<'static>`

Creates a new event. For events that carry variable-length data (e.g. Sysex), `new_ext` has to be used instead.

#### `fn new_ext<D: Into<Cow<'a, [u8]>>>(t: EventType, data: D) -> Event<'a>`

Creates a new event carrying variable-length data. This is required for event types `Sysex`, `Bounce`, and the `UsrVar` types.

#### `fn into_owned(self) -> Event<'static>`

Consumes this event and returns an (otherwise unchanged) event where the externally referenced buffer for variable length messages (e.g. SysEx) has been copied into the event. The returned event has a static lifetime, i e, it's decoupled from the original buffer.

#### `fn get_type(&self) -> EventType`

#### `fn get_data<D: EventData>(&self) -> Option<D>`

Extract the event data from an event. Use `get_ext` instead for events carrying variable-length data.

#### `fn get_ext<'b>(&'b self) -> Option<&'b [u8]>`

Extract the variable-length data carried by events of type `Sysex`, `Bounce`, or the `UsrVar` types.

#### `fn set_subs(&mut self)`

#### `fn set_source(&mut self, p: i32)`

#### `fn set_dest(&mut self, d: Addr)`

#### `fn set_tag(&mut self, t: u8)`

#### `fn set_queue(&mut self, q: i32)`

#### `fn get_source(&self) -> Addr`

#### `fn get_dest(&self) -> Addr`

#### `fn get_tag(&self) -> u8`

#### `fn get_queue(&self) -> i32`

#### `fn schedule_real(&mut self, queue: i32, relative: bool, rtime: Duration)`

#### `fn schedule_tick(&mut self, queue: i32, relative: bool, ttime: u32)`

#### `fn set_direct(&mut self)`

#### `fn get_relative(&self) -> bool`

#### `fn get_time(&self) -> Option<Duration>`

#### `fn get_tick(&self) -> Option<u32>`

#### `fn get_priority(&self) -> bool`

Returns true if the message is high priority.

#### `fn set_priority(&mut self, is_high_prio: bool)`

## Trait Implementations

### `impl<'a> Send for Event<'a>`
[src]

### `impl<'a> Clone for Event<'a>`
[src]

#### `fn clone(&self) -> Self`

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0

Performs copy-assignment from `source`. Read more

### `impl<'a> Debug for Event<'a>`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)