Skip to main content

CommandRecorder

Struct CommandRecorder 

Source
pub struct CommandRecorder { /* private fields */ }
Expand description

Mutable command data owned exclusively while a draw scope records it. Publishing with Self::finish shares the completed shape data without copying it.

Implementations§

Source§

impl CommandRecorder

Source

pub fn from_primitives( primitives: impl IntoIterator<Item = DrawPrimitive>, ) -> Self

Records primitives in order into owned command data.

Source

pub fn reusing(recording: CommandRecording) -> Self

Reuses a completed command’s buffer capacities for an empty recording. Retained readers keep their original shape data.

Source

pub fn finish(self) -> CommandRecording

Publishes completed command data without copying its shape columns.

Source

pub fn len(&self) -> usize

Every recorded entry, including content markers.

Source

pub fn is_empty(&self) -> bool

Whether this recorder contains no entries.

Source

pub fn content_markers(&self) -> u32

The number of recorded content markers.

Source

pub fn clear(&mut self)

Empties the recording, keeping every buffer’s capacity for the next recording into it.

Source

pub fn reserve_shapes(&mut self, additional: usize)

Reserves capacity for additional shape records.

Source

pub fn push_content(&mut self)

Records a content marker at the current command position.

Source

pub fn push_primitive(&mut self, primitive: DrawPrimitive)

Records a primitive the way the draw scope would have: shapes and blended shapes become records, everything else joins the others lane.

Source

pub fn push_rect( &mut self, rect: Rect, brush: &Brush, stroke: Option<Stroke>, blend: BlendMode, )

Records a rectangle with its brush, optional stroke and blend mode.

Source

pub fn push_round_rect( &mut self, rect: Rect, brush: &Brush, radii: CornerRadii, stroke: Option<Stroke>, blend: BlendMode, )

Records a rounded rectangle with its corner radii and paint.

Source

pub fn push_arc(&mut self, rect: Rect, args: &ArcRecordArgs<'_>)

Records an arc band or annular sector with the rect the primitive carries.

Source

pub fn push_scope_arc( &mut self, args: &ArcRecordArgs<'_>, geometry: &ArcGeometry, )

Records an arc the draw scope drew, whose band the scope already normalised: the record keeps the disc around the band as its rect and derives the primitive’s tight bounds only when asked.

Source

pub fn push_other(&mut self, primitive: DrawPrimitive)

Records a primitive in the non-shape lane and updates its metadata.

Source

pub fn merge_summary(&mut self, other: RecordingSummary)

Folds other’s summary into this recording’s, for callers that combine recordings.

Trait Implementations§

Source§

impl Clone for CommandRecorder

Source§

fn clone(&self) -> CommandRecorder

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 Debug for CommandRecorder

Source§

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

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

impl Default for CommandRecorder

Source§

fn default() -> CommandRecorder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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.