pub struct Instance<T: Layout> { /* private fields */ }
Expand description
A generic layout instance.
Stores a pointer to its underlying cell and its instantiated transformation.
Implementations§
Source§impl<T: Layout> Instance<T>
impl<T: Layout> Instance<T>
Sourcepub fn try_cell(&self) -> Result<TransformedCell<T>>
pub fn try_cell(&self) -> Result<TransformedCell<T>>
Tries to access a transformed view of the underlying Cell
, blocking on generation.
Blocks until cell generation completes.
The returned object provides coordinates in the parent cell’s coordinate system.
If you want coordinates in the child cell’s coordinate system,
consider using Instance::try_raw_cell
instead.
Returns an error if one was thrown during generation.
Sourcepub fn cell(&self) -> TransformedCell<T>
pub fn cell(&self) -> TransformedCell<T>
Returns a transformed view of the underlying Cell
.
Blocks until cell generation completes.
The returned object provides coordinates in the parent cell’s coordinate system.
If you want coordinates in the child cell’s coordinate system,
consider using Instance::raw_cell
instead.
§Panics
Panics if an error was thrown during generation.
Sourcepub fn try_raw_cell(&self) -> Result<&Cell<T>>
pub fn try_raw_cell(&self) -> Result<&Cell<T>>
Tries to access a transformed view of the underlying Cell
, blocking on generation.
Blocks until cell generation completes.
The returned cell does not store any information related
to this instance’s transformation.
Consider using Instance::try_cell
instead.
Returns an error if one was thrown during generation.
Sourcepub fn raw_cell(&self) -> &Cell<T>
pub fn raw_cell(&self) -> &Cell<T>
Returns a transformed view of the underlying Cell
.
Blocks until cell generation completes.
The returned cell does not store any information related
to this instance’s transformation.
Consider using Instance::cell
instead.
§Panics
Panics if an error was thrown during generation.
Sourcepub fn try_data(&self) -> Result<T::Data>
pub fn try_data(&self) -> Result<T::Data>
Tries to access extra data created by the cell’s schematic generator.
Blocks until cell generation completes.
Returns an error if one was thrown during generation.
Sourcepub fn data(&self) -> T::Data
pub fn data(&self) -> T::Data
Tries to access extra data created by the cell’s schematic generator.
Blocks until cell generation completes.
§Panics
Panics if an error was thrown during generation.
Sourcepub fn try_io(&self) -> Result<T::Bundle>
pub fn try_io(&self) -> Result<T::Bundle>
Returns a transformed view of the underlying Cell
’s IO.
Blocks until cell generation completes.
Returns an error if one was thrown during generation.
Sourcepub fn transformation(&self) -> &Transformation
pub fn transformation(&self) -> &Transformation
The transformation of this instance.
Sourcepub fn transformation_mut(&mut self) -> &mut Transformation
pub fn transformation_mut(&mut self) -> &mut Transformation
A mutable reference to a transformation of this instance.
Trait Implementations§
Source§impl<T: Layout> TransformMut for Instance<T>
impl<T: Layout> TransformMut for Instance<T>
Source§fn transform_mut(&mut self, trans: Transformation)
fn transform_mut(&mut self, trans: Transformation)
Transformation
trans
.Source§impl<T: Layout> TransformRef for Instance<T>
impl<T: Layout> TransformRef for Instance<T>
Source§fn transform_ref(&self, trans: Transformation) -> Self
fn transform_ref(&self, trans: Transformation) -> Self
Transformation
trans
.Source§impl<T: Layout> TranslateMut for Instance<T>
impl<T: Layout> TranslateMut for Instance<T>
Source§fn translate_mut(&mut self, p: Point)
fn translate_mut(&mut self, p: Point)
Point
through mutation.Source§impl<T: Layout> TranslateRef for Instance<T>
impl<T: Layout> TranslateRef for Instance<T>
Source§fn translate_ref(&self, p: Point) -> Self
fn translate_ref(&self, p: Point) -> Self
Point
, returning a new shape.Auto Trait Implementations§
impl<T> Freeze for Instance<T>
impl<T> !RefUnwindSafe for Instance<T>
impl<T> Send for Instance<T>
impl<T> Sync for Instance<T>
impl<T> Unpin for Instance<T>
impl<T> !UnwindSafe for Instance<T>
Blanket Implementations§
Source§impl<T> AlignBbox for Twhere
T: AlignBboxMut,
impl<T> AlignBbox for Twhere
T: AlignBboxMut,
Source§impl<T> AlignBboxMut for Twhere
T: AlignRectMut + Bbox,
impl<T> AlignBboxMut for Twhere
T: AlignRectMut + Bbox,
Source§impl<T> AlignRect for Twhere
T: AlignRectMut,
impl<T> AlignRect for Twhere
T: AlignRectMut,
Source§impl<T> AlignRectMut for Twhere
T: Translate,
impl<T> AlignRectMut for Twhere
T: Translate,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Source§impl<S, T> DrawBoxed<S> for T
impl<S, T> DrawBoxed<S> for T
Source§fn draw_boxed(self: Box<T>, recv: &mut DrawReceiver<S>) -> Result<(), Error>
fn draw_boxed(self: Box<T>, recv: &mut DrawReceiver<S>) -> Result<(), Error>
self
inside recv
.§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