pub struct TextWorkspace { /* private fields */ }Expand description
Reusable heap storage for private paragraph-layout intermediates.
Implementations§
Source§impl TextWorkspace
impl TextWorkspace
Sourcepub const fn new(limits: LayoutLimits) -> Self
pub const fn new(limits: LayoutLimits) -> Self
Creates an empty workspace that grows within limits on demand.
Sourcepub fn try_new_bounded(
limits: LayoutLimits,
capacity: WorkspaceCapacity,
) -> Result<Self, WorkspaceError>
pub fn try_new_bounded( limits: LayoutLimits, capacity: WorkspaceCapacity, ) -> Result<Self, WorkspaceError>
Builds a bounded workspace, releasing any partial reservation on failure.
pub const fn limits(&self) -> LayoutLimits
Sourcepub fn reserve_bounded(
&mut self,
capacity: WorkspaceCapacity,
) -> Result<(), WorkspaceError>
pub fn reserve_bounded( &mut self, capacity: WorkspaceCapacity, ) -> Result<(), WorkspaceError>
Reserves private storage and rejects subsequent growth beyond capacity.
A failed reservation on an existing workspace may retain partial allocations;
use try_new_bounded when construction must be all-or-nothing.
Sourcepub fn set_memory_limit(
&mut self,
memory_bytes: usize,
) -> Result<(), WorkspaceError>
pub fn set_memory_limit( &mut self, memory_bytes: usize, ) -> Result<(), WorkspaceError>
Updates the private-buffer byte limit without releasing retained capacity.
Sourcepub fn resident_bytes(&self) -> usize
pub fn resident_bytes(&self) -> usize
Returns allocated element capacity for private pipeline buffers.
Auto Trait Implementations§
impl Forget for TextWorkspace
impl Freeze for TextWorkspace
impl RefUnwindSafe for TextWorkspace
impl Send for TextWorkspace
impl Sync for TextWorkspace
impl Unpin for TextWorkspace
impl UnsafeUnpin for TextWorkspace
impl UnwindSafe for TextWorkspace
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