[−][src]Struct xkbcommon::xkb::Context
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.
Methods
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.
ⓘImportant traits for ContextIncludePaths<'a>pub fn include_paths<'a>(&'a self) -> ContextIncludePaths<'a>[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
Auto Trait Implementations
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
impl RefUnwindSafe for Context
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,