# Struct ocl_core::types::abs::Event [−] [src]

    #[repr(C)]
    pub struct Event(_);

cl_event

## Methods

### `impl Event`
[src]

#### `pub fn null() -> Event`
[src]

For passage directly to an 'event creation' function (such as enqueue...).

#### `pub fn user<C: ClContextPtr>(context: C) -> OclCoreResult<Event>`
[src]

Creates and returns a new 'user' event.

User events are events which are meant to have their completion status set from the host side (that means you).

#### `pub unsafe fn from_raw_create_ptr(ptr: cl_event) -> Event`
[src]

Only call this when passing the original newly created pointer directly from `clCreate...`. Do not use this to clone or copy.

#### `pub unsafe fn from_raw_copied_ptr(ptr: cl_event) -> OclCoreResult<Event>`
[src]

Only use when cloning or copying from a pre-existing and valid `cl_event`.

#### `pub fn set_complete(&self) -> OclCoreResult<()>`
[src]

Sets this user created event to `CommandExecutionStatus::Complete`.

Will return an error if this event is not a 'user' event (created with `::user()`).

#### `pub fn is_complete(&self) -> OclCoreResult<bool>`
[src]

Queries the command status associated with this event and returns true if it is complete, false if incomplete or upon error.

This is the fastest possible way to determine event status.

#### `pub fn wait_for(&self) -> OclCoreResult<()>`
[src]

Causes the command queue to wait until this event is complete before returning.

#### `pub fn is_null(&self) -> bool`
[src]

Returns whether or not this event is associated with a command or is a user event.

#### `pub fn is_valid(&self) -> bool`
[src]

[FIXME]: ADD VALIDITY CHECK BY CALLING '_INFO' OR SOMETHING: NULL CHECK IS NOT ENOUGH

This still leads to crazy segfaults when non-event pointers (random whatever addresses) are passed. Need better check.

#### `pub unsafe fn set_callback(
&self,
callback_receiver: EventCallbackFn,
user_data_ptr: *mut c_void
) -> OclCoreResult<()>`
[src]

Sets a callback function, `callback_receiver`, to trigger upon completion of this event with an optional pointer to user data.

The callback function must have a signature matching: `extern "C" fn (ffi::cl_event, i32, *mut libc::c_void)`

# Safety

`user_data` must be guaranteed to still exist if and when `callback_receiver` is ever called.

TODO: Create a safer type wrapper for `callback_receiver` (using an `Arc`?, etc.) within `ocl`.

#### `pub fn context(&self) -> OclCoreResult<Context>`
[src]

Returns the `Context` associated with this event.

#### `pub unsafe fn as_ptr_ref(&self) -> &cl_event`
[src]

Returns an immutable reference to a pointer, do not deref and store it unless you will manage its associated reference count carefully.

### Warning

DO NOT store this pointer.

DO NOT send this pointer across threads unless you are incrementing the reference count before sending and decrementing after sending.

Use `::into_raw` for these purposes. Thank you.

#### `pub unsafe fn as_ptr_mut(&mut self) -> &mut cl_event`
[src]

Returns a mutable reference to a pointer, do not deref then modify or store it unless you will manage its associated reference count carefully.

### Warning

DO NOT store this pointer.

DO NOT send this pointer across threads unless you are incrementing the reference count before sending and decrementing after sending.

Use `::into_raw` for these purposes. Thank you.

#### `pub fn into_raw(self) -> cl_event`
[src]

Consumes the `Event`, returning the wrapped `cl_event` pointer.

To avoid a memory leak the pointer must be converted back to an `Event` using `Event::from_raw`.

#### `pub unsafe fn from_raw(ptr: cl_event) -> Event`
[src]

Constructs an `Event` from a raw `cl_event` pointer.

The raw pointer must have been previously returned by a call to a `Event::into_raw`.

## Trait Implementations

### `impl Debug for Event`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl Hash for Event`
[src]

#### `fn hash<__H: Hasher>(&self, __arg_0: &mut __H)`
[src]

Feeds this value into the given [`Hasher`]. Read more

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,`
1.3.0
[src]

Feeds a slice of this type into the given [`Hasher`]. Read more

### `impl PartialEq for Event`
[src]

#### `fn eq(&self, __arg_0: &Event) -> bool`
[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, __arg_0: &Event) -> bool`
[src]

This method tests for `!=`.

### `impl Eq for Event`
[src]

### `impl<'a> ClNullEventPtr for &'a mut Event`
[src]

#### `fn alloc_new(&mut self) -> *mut cl_event`
[src]

#### `unsafe fn clone_from<E: AsRef<Event>>(&mut self, ev: E)`
[src]

### `impl ClWaitListPtr for Event`
[src]

#### `unsafe fn as_ptr_ptr(&self) -> *const cl_event`
[src]

Returns a pointer to the first pointer in this list.

#### `fn count(&self) -> u32`
[src]

Returns the number of items in this wait list.

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

#### `unsafe fn as_ptr_ptr(&self) -> *const cl_event`
[src]

Returns a pointer to the first pointer in this list.

#### `fn count(&self) -> u32`
[src]

Returns the number of items in this wait list.

### `impl<'e> ClEventPtrRef<'e> for Event`
[src]

#### `unsafe fn as_ptr_ref(&'e self) -> &'e cl_event`
[src]

### `impl AsRef<Event> for Event`
[src]

#### `fn as_ref(&self) -> &Event`
[src]

Performs the conversion.

### `impl Clone for Event`
[src]

#### `fn clone(&self) -> Event`
[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from `source`. Read more

### `impl Drop for Event`
[src]

#### `fn drop(&mut self)`
[src]

Executes the destructor for this type. Read more

### `impl Sync for Event`
[src]

### `impl Send for Event`
[src]

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse 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`)