pub struct Builder { /* private fields */ }Expand description
Incrementally validates commands and layer grammar before producing a display list. Discard the builder after an error; prior structural charges are not rolled back.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new(
size: PixelSize,
limits: ValidationLimits,
) -> Result<Self, ValidationError>
pub fn new( size: PixelSize, limits: ValidationLimits, ) -> Result<Self, ValidationError>
Creates an empty list with checked output dimensions and structural limits.
Sourcepub fn push(
&mut self,
command: DrawCommand,
path: &str,
) -> Result<(), ValidationError>
pub fn push( &mut self, command: DrawCommand, path: &str, ) -> Result<(), ValidationError>
Validates and charges a command at the supplied diagnostic path before storing it.
Sourcepub fn finish(self) -> Result<DisplayList, ValidationError>
pub fn finish(self) -> Result<DisplayList, ValidationError>
Returns the list only when every layer and mask scope has been closed.
Sourcepub fn finish_validated(self) -> Result<ValidatedDisplayList, ValidationError>
pub fn finish_validated(self) -> Result<ValidatedDisplayList, ValidationError>
Freezes already checked commands without repeating structural traversal.
Auto Trait Implementations§
impl !RefUnwindSafe for Builder
impl !UnwindSafe for Builder
impl Forget for Builder
impl Freeze for Builder
impl Move for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more