Skip to main content

RenderCommandOutput

Enum RenderCommandOutput 

Source
pub enum RenderCommandOutput<Custom> {
    Element(RenderCommandOutputElement<Custom>),
    ClipStart(RenderCommandClipStart),
    ClipEnd(RenderCommandClipEnd),
}
Expand description

One step in the layout-to-renderer command stream.

Emitted in depth-first tree order with z-index sorting applied per subtree root. Pipes translate each variant into renderer draw calls.

§Examples

use cotis::utils::ElementIdConfig;
use cotis_layout::layout_struct::{
    RenderCommandClipEnd, RenderCommandClipStart, RenderCommandOutput,
    RenderCommandOutputElement,
};
use cotis_utils::math::BoundingBox;

let id = ElementIdConfig::new_empty().get_handle();
let bounds = BoundingBox { x: 0.0, y: 0.0, width: 100.0, height: 50.0 };

let element: RenderCommandOutput<&str> = RenderCommandOutput::Element(RenderCommandOutputElement {
    bounds,
    z_index: 0,
    text: None,
    custom: "my-payload",
});

let clip_start: RenderCommandOutput<()> = RenderCommandOutput::ClipStart(RenderCommandClipStart {
    bounds,
    id: id.clone(),
    z_index: 1,
});

let clip_end: RenderCommandOutput<()> = RenderCommandOutput::ClipEnd(RenderCommandClipEnd {
    bounds,
    id,
    z_index: 1,
});

assert!(matches!(element, RenderCommandOutput::Element(_)));
assert!(matches!(clip_start, RenderCommandOutput::ClipStart(_)));
assert!(matches!(clip_end, RenderCommandOutput::ClipEnd(_)));

Variants§

§

Element(RenderCommandOutputElement<Custom>)

A sized and positioned element ready for rendering.

§

ClipStart(RenderCommandClipStart)

Begin clip scissor for a scroll/clip container.

§

ClipEnd(RenderCommandClipEnd)

End clip scissor for a scroll/clip container.

Trait Implementations§

Source§

impl<Custom: Clone> Clone for RenderCommandOutput<Custom>

Source§

fn clone(&self) -> RenderCommandOutput<Custom>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Custom: Debug> Debug for RenderCommandOutput<Custom>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'frame, T> LayoutFrameManager<'frame, T, RenderCommandOutput<T>, CotisLayoutRun<'_, T>> for CotisLayoutRun<'_, T>
where T: CotisLayoutCompatible<'frame> + 'frame,

Source§

fn begin(&mut self) -> ConfiguredParentElement<'_, Self, T>

Begins configuration at the root of the UI tree for this frame.
Source§

fn end(self) -> impl Iterator<Item = RenderCommandOutput<T>>

Completes frame construction and returns the frame output iterator.
Source§

impl<'frame, T> LayoutManager<'frame, T, RenderCommandOutput<T>> for CotisLayoutManager
where T: CotisLayoutCompatible<'frame> + 'frame,

Source§

type ElementConfigurer<'layout> = CotisLayoutRun<'layout, T> where Self: 'layout

The configurator type used while constructing one frame.
Source§

fn begin_frame<'layout>( &'layout mut self, ) -> impl LayoutFrameManager<'frame, T, RenderCommandOutput<T>, Self::ElementConfigurer<'layout>>
where T: 'frame, RenderCommandOutput<T>: 'frame, Self: 'layout,

Starts a new frame and returns a frame manager used to build UI.

Auto Trait Implementations§

§

impl<Custom> Freeze for RenderCommandOutput<Custom>
where Custom: Freeze,

§

impl<Custom> RefUnwindSafe for RenderCommandOutput<Custom>
where Custom: RefUnwindSafe,

§

impl<Custom> Send for RenderCommandOutput<Custom>
where Custom: Send,

§

impl<Custom> Sync for RenderCommandOutput<Custom>
where Custom: Sync,

§

impl<Custom> Unpin for RenderCommandOutput<Custom>
where Custom: Unpin,

§

impl<Custom> UnsafeUnpin for RenderCommandOutput<Custom>
where Custom: UnsafeUnpin,

§

impl<Custom> UnwindSafe for RenderCommandOutput<Custom>
where Custom: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Source
where TailTarget: IsRenderList, Source: Embed<TailTarget, Idx>,

Source§

fn embed(self) -> RenderTList<H, TailTarget>

Converts self into Target.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.