pub struct CellBuilder<S: Schema> {
pub ctx: Context,
/* private fields */
}
Expand description
A layout cell builder.
Constructed once for each invocation of Layout::layout
.
Fields§
§ctx: Context
The current global context.
Implementations§
Source§impl<S: Schema> CellBuilder<S>
impl<S: Schema> CellBuilder<S>
Sourcepub fn generate<I: Layout>(&mut self, block: I) -> Instance<I>
pub fn generate<I: Layout>(&mut self, block: I) -> Instance<I>
Generate an instance of block
.
Returns immediately, allowing generation to complete in the background. Attempting to access the generated instance’s cell will block until generation is complete.
Sourcepub fn generate_blocking<I: Layout>(&mut self, block: I) -> Result<Instance<I>>
pub fn generate_blocking<I: Layout>(&mut self, block: I) -> Result<Instance<I>>
Generate an instance of block
.
Blocks on generation, returning only once the instance’s cell is populated. Useful for handling errors thrown by the generation of a cell immediately.
Sourcepub fn draw(&mut self, obj: impl Draw<S>) -> Result<()>
pub fn draw(&mut self, obj: impl Draw<S>) -> Result<()>
Draw layout object obj
.
For instances, a new thread is spawned to add the instance once the underlying cell has been generated. If generation fails, the spawned thread may panic after this function has been called.
For error recovery, instance generation results should be checked using Instance::try_cell
before calling draw
.
§Panics
May cause a panic if generation of an underlying instance fails.
Trait Implementations§
Source§impl<S: Schema> Bbox for CellBuilder<S>
impl<S: Schema> Bbox for CellBuilder<S>
Auto Trait Implementations§
impl<S> Freeze for CellBuilder<S>
impl<S> !RefUnwindSafe for CellBuilder<S>
impl<S> Send for CellBuilder<S>where
S: Send,
impl<S> Sync for CellBuilder<S>where
S: Sync,
impl<S> Unpin for CellBuilder<S>
impl<S> !UnwindSafe for CellBuilder<S>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request