Struct snek::Symbol [] [src]

pub struct Symbol<'a> { /* fields omitted */ }

This provides an interface around a symbol loaded from a dynamic library. This should not be constructed manually, but returned from Snek::symbol or used internally via the snek! macro.

Methods

impl<'a> Symbol<'a>
[src]

Construct a new Symbol wrapping a symbol. This should not be used manually, however is public to allow access from the snek! macro.

Use the symbol as if it was a certain type. There is no way of checking that the symbol is of the specified type, so this function should be used with care.

Safety

When calling this function, ensure the type of the symbol is actually the type you say it is.

Example

let result: c_int =  unsafe { symbol.with(|add: extern fn(c_int, c_int) -> c_int| add(3, 7)) };

Trait Implementations

impl<'a> Debug for Symbol<'a>
[src]

Formats the value using the given formatter.