Trait Platform

Source
pub trait Platform: 'static {
    type ContainerID: Copy + Eq + Hash + Send;
    type Container: Container<Self>;
    type Component: Component<Self>;
    type Compositor: Compositor<Self>;
    type CommandBuffer: CommandBuffer<Self>;
    type Environment;

    // Required method
    fn with_compositor<F>(container: Self::Container, task: F) -> Disposable
       where F: FnOnce(Self::ContainerID, Self::Compositor, EventLoop) -> Disposable + Send + 'static;
}
Expand description

This is a platform that needs to be implemented by every render host.

Required Associated Types§

Source

type ContainerID: Copy + Eq + Hash + Send

This is a virtual container that renders a built-in. These containers should be thread-safe (e.g. Send + Sync).

Source

type Container: Container<Self>

This is a native container that renders a built-in. For example, this can be an UIView or a div. Native containers are usually not thread-safe and reside only on the main thread.

Source

type Component: Component<Self>

Source

type Compositor: Compositor<Self>

Source

type CommandBuffer: CommandBuffer<Self>

Source

type Environment

Required Methods§

Source

fn with_compositor<F>(container: Self::Container, task: F) -> Disposable
where F: FnOnce(Self::ContainerID, Self::Compositor, EventLoop) -> Disposable + Send + 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§