pub enum SurfaceExtent {
Fixed(u32),
Content,
}Expand description
Per-axis sizing for layer surfaces.
Fixed is a size in logical pixels (plain integers convert into it).
Content follows the content’s natural size on that axis — the
content() constructor reads like fill()
and friends:
SurfaceConfig::new()
.width(360) // fixed
.height(content()); // follows the toast stackContent semantics, designed to stay footgun-free:
- Resizing is asynchronous (one compositor round trip per change) and happens on CONTENT changes, not per animation frame: the natural size is measured against animation targets, so an animated growth resizes once up front and the animation plays inside the final-size surface.
- On an axis anchored to both screen edges the compositor owns the
size;
Contentthere is ignored with a warning at creation. - An exclusive zone of
ExclusiveZone::Autofollows content resizes; every other policy never moves.
Variants§
Trait Implementations§
Source§impl Clone for SurfaceExtent
impl Clone for SurfaceExtent
impl Copy for SurfaceExtent
Source§impl Debug for SurfaceExtent
impl Debug for SurfaceExtent
impl Eq for SurfaceExtent
Source§impl From<i32> for SurfaceExtent
impl From<i32> for SurfaceExtent
Source§impl From<u32> for SurfaceExtent
impl From<u32> for SurfaceExtent
Source§impl PartialEq for SurfaceExtent
impl PartialEq for SurfaceExtent
impl StructuralPartialEq for SurfaceExtent
Auto Trait Implementations§
impl Freeze for SurfaceExtent
impl RefUnwindSafe for SurfaceExtent
impl Send for SurfaceExtent
impl Sync for SurfaceExtent
impl Unpin for SurfaceExtent
impl UnsafeUnpin for SurfaceExtent
impl UnwindSafe for SurfaceExtent
Blanket Implementations§
Source§impl<T, M, S> Animate<T, M> for Swhere
T: Clone + 'static,
S: IntoSignal<T, M>,
impl<T, M, S> Animate<T, M> for Swhere
T: Clone + 'static,
S: IntoSignal<T, M>,
Source§fn transition(self, transition: impl Into<TransitionConfig>) -> Animated<T>
fn transition(self, transition: impl Into<TransitionConfig>) -> Animated<T>
Ease to each new value this holds, instead of jumping to it. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.