Struct kas_wgpu::Toolkit[][src]

pub struct Toolkit<C: CustomPipe, T: Theme<DrawPipe<C>>> { /* fields omitted */ }

A toolkit over winit and WebGPU

All KAS shells are expected to provide a similar Toolkit type and API. There is no trait abstraction over this API simply because there is very little reason to do so (and some reason not to: KISS).

Implementations

impl<T: Theme<DrawPipe<()>> + 'static> Toolkit<(), T> where
    T::Window: Window
[src]

pub fn new(theme: T) -> Result<Self, Error>[src]

Construct a new instance with default options.

Environment variables may affect option selection; see documentation of Options::from_env. KAS config is provided by Options::config.

impl<C: CustomPipe + 'static, T: Theme<DrawPipe<C>> + 'static> Toolkit<C, T> where
    T::Window: Window
[src]

pub fn new_custom<CB: CustomPipeBuilder<Pipe = C>>(
    custom: CB,
    theme: T,
    options: Options
) -> Result<Self, Error>
[src]

Construct an instance with custom options

The custom parameter accepts a custom draw pipe (see CustomPipeBuilder). Pass () if you don’t have one.

The Options parameter allows direct specification of shell options; usually, these are provided by Options::from_env. KAS config is provided by Options::config.

pub fn new_custom_config<CB: CustomPipeBuilder<Pipe = C>>(
    custom: CB,
    theme: T,
    options: Options,
    config: Rc<RefCell<Config>>
) -> Result<Self, Error>
[src]

Construct an instance with custom options and config

This is like Toolkit::new_custom, but allows KAS config to be specified directly, instead of loading via Options::config.

pub fn add<W: Window + 'static>(&mut self, window: W) -> Result<WindowId, Error>[src]

Assume ownership of and display a window

This is a convenience wrapper around Toolkit::add_boxed.

Note: typically, one should have W: Clone, enabling multiple usage.

pub fn with<W: Window + 'static>(self, window: W) -> Result<Self, Error>[src]

Assume ownership of and display a window, inline

This is a convenience wrapper around Toolkit::add_boxed.

Note: typically, one should have W: Clone, enabling multiple usage.

pub fn add_boxed(&mut self, widget: Box<dyn Window>) -> Result<WindowId, Error>[src]

Add a boxed window directly

pub fn with_boxed(self, widget: Box<dyn Window>) -> Result<Self, Error>[src]

Add a boxed window directly, inline

pub fn create_proxy(&self) -> ToolkitProxy[src]

Create a proxy which can be used to update the UI from another thread

pub fn run(self) -> ![src]

Run the main loop.

Auto Trait Implementations

impl<C, T> !RefUnwindSafe for Toolkit<C, T>

impl<C, T> !Send for Toolkit<C, T>

impl<C, T> !Sync for Toolkit<C, T>

impl<C, T> Unpin for Toolkit<C, T> where
    C: Unpin,
    T: Unpin,
    <C as CustomPipe>::Window: Unpin,
    <T as Theme<DrawPipe<C>>>::Window: Unpin

impl<C, T> !UnwindSafe for Toolkit<C, T>

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<S, T> Cast<T> for S where
    T: Conv<S>, 

impl<S, T> CastFloat<T> for S where
    T: ConvFloat<S>, 

impl<T> Conv<T> for T

impl<T> Downcast<T> for T

impl<'a, T, X> Filter<&'a T> for X where
    T: Clone,
    X: Filter<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

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.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,