Struct xkbcommon::xkb::Context[][src]

pub struct Context { /* fields omitted */ }

Top level library context object.

The context contains various general library data and state, like logging level and include paths.

Objects are created in a specific context, and multiple contexts may coexist simultaneously. Objects from different contexts are completely separated and do not share any memory or state.

Implementations

impl Context[src]

pub unsafe fn from_raw_ptr(ptr: *mut xkb_context) -> Context[src]

contruct a context from a raw ffi pointer. This context must already been referenced as xkb_context_unref will be called at drop time

pub fn get_raw_ptr(&self) -> *mut xkb_context[src]

get the raw pointer from this context

pub fn new(flags: ContextFlags) -> Context[src]

Create a new context.

flags Optional flags for the context, or 0.

The user may set some environment variables to affect default values in the context.

pub fn include_path_append(&mut self, path: &Path) -> bool[src]

append a new entry to the context’s include path returns true on success, or false if the include path could not be added or is inaccessible

pub fn include_path_append_default(&mut self) -> bool[src]

Append the default include paths to the context’s include path.

Returns true on success.

pub fn include_path_reset_defaults(&mut self) -> bool[src]

Reset the context’s include path to the default.

Removes all entries from the context’s include path, and inserts the default paths.

Returns true on success.yy

pub fn include_path_clear(&mut self)[src]

Remove all entries from the context’s include path.

pub fn include_paths<'a>(&'a self) -> ContextIncludePaths<'a>

Notable traits for ContextIncludePaths<'a>

impl<'a> Iterator for ContextIncludePaths<'a> type Item = &'a Path;
[src]

get an iterator on the include paths of this context

pub fn set_log_level(&mut self, level: LogLevel)[src]

Set the current logging level.

The default level is xkb::LogLevel::Error. The environment variable XKB_LOG_LEVEL, if set in the time the context was created, overrides the default value. It may be specified as a level number or name.

pub fn get_log_level(&self) -> LogLevel[src]

pub fn set_log_verbosity(&mut self, verbosity: i32)[src]

Sets the current logging verbosity.

The library can generate a number of warnings which are not helpful to ordinary users of the library. The verbosity may be increased if more information is desired (e.g. when developing a new keymap).

The default verbosity is 0. The environment variable XKB_LOG_VERBOSITY, if set in the time the context was created, overrides the default value.

verbosity can be set from 1 to 10, higher values being more verbose. 0 would result in no verbose messages being logged.

Most verbose messages are of level xkb::LogLevel::Warning or lower.

pub fn get_log_verbosity(&self) -> i32[src]

Trait Implementations

impl Clone for Context[src]

impl Drop for Context[src]

Auto Trait Implementations

impl RefUnwindSafe for Context

impl !Send for Context

impl !Sync for Context

impl Unpin for Context

impl UnwindSafe for Context

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.