pub struct EmbeddedRegion {
pub relative_to: LogicalRegion,
pub inner: Region,
}Expand description
An embedded region is a region entirely inside of another (often an output).
It can only be contained inside of another and cannot exceed its bounds.
Example:
ⓘ
┌─────────────┐
│ │
│ ┌──────────┼──────┐
│ │ │ ├──► Viewport
│ │ │ │
│ │ ├──────┼─────────────────┐
│ │ │xxxxxx│ │
│ │ │xxxxx◄├─── Inner region │
│ └──────────┼──────┘ │
│ │ │
│ │ Screen 2 ├──► Relative to
│ ├────────────────────────┘
│ │
│ Screen 1 │
└─────────────┘Fields§
§relative_to: LogicalRegionThe coordinate sysd
inner: RegionImplementations§
Source§impl EmbeddedRegion
impl EmbeddedRegion
Sourcepub fn new(viewport: LogicalRegion, relative_to: LogicalRegion) -> Option<Self>
pub fn new(viewport: LogicalRegion, relative_to: LogicalRegion) -> Option<Self>
Given two LogicalRegions, one seen as the viewport and the other
relative_to (think the output we want to capture), create an
embedded region that is entirely inside of the relative_to region.
See EmbeddedRegion for an example ASCII visualisation.
Sourcepub fn logical(&self) -> LogicalRegion
pub fn logical(&self) -> LogicalRegion
Return the LogicalRegion of the embedded region.
Note that this remains a region of the same size, it’s not the inverse
of EmbeddedRegion::new which removes the parts that are outside of
the relative_to region.
Trait Implementations§
Source§impl Clone for EmbeddedRegion
impl Clone for EmbeddedRegion
Source§fn clone(&self) -> EmbeddedRegion
fn clone(&self) -> EmbeddedRegion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbeddedRegion
impl Debug for EmbeddedRegion
Source§impl Display for EmbeddedRegion
impl Display for EmbeddedRegion
impl Copy for EmbeddedRegion
Auto Trait Implementations§
impl Freeze for EmbeddedRegion
impl RefUnwindSafe for EmbeddedRegion
impl Send for EmbeddedRegion
impl Sync for EmbeddedRegion
impl Unpin for EmbeddedRegion
impl UnwindSafe for EmbeddedRegion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.