Struct kas_wgpu::Toolkit [−][src]
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]
T::Window: Window,
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]
T::Window: Window,
pub fn new_custom<CB: CustomPipeBuilder<Pipe = C>>(
custom: CB,
theme: T,
options: Options
) -> Result<Self, Error>[src]
custom: CB,
theme: T,
options: Options
) -> Result<Self, Error>
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]
custom: CB,
theme: T,
options: Options,
config: Rc<RefCell<Config>>
) -> Result<Self, Error>
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,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<S, T> Cast<T> for S where
T: Conv<S>,
T: Conv<S>,
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>,
T: ConvFloat<S>,
pub fn cast_trunc(self) -> T
pub fn cast_nearest(self) -> T
pub fn cast_floor(self) -> T
pub fn cast_ceil(self) -> T
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
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]
T: Clone,
X: Filter<T>,
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Upcast<T> for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,