pub struct ScrollBehaviorRef(/* private fields */);Expand description
A ScrollBehavior held by value: what a Dart field or parameter typed ScrollBehavior
becomes.
It is a newtype rather than a bare Rc so that copy_with — which
Dart writes as a method capturing this as the new wrapper’s delegate — has an Rc to
capture.
Implementations§
Source§impl ScrollBehaviorRef
impl ScrollBehaviorRef
Sourcepub fn new(behavior: impl ScrollBehavior) -> ScrollBehaviorRef
pub fn new(behavior: impl ScrollBehavior) -> ScrollBehaviorRef
Erases a ScrollBehavior.
Sourcepub fn plain() -> ScrollBehaviorRef
pub fn plain() -> ScrollBehaviorRef
Dart’s const ScrollBehavior().
Sourcepub fn copy_with(&self) -> WrappedScrollBehavior
pub fn copy_with(&self) -> WrappedScrollBehavior
Creates a copy of this behavior, making it possible to
easily toggle scrollbars and overscroll effects.
This is used by widgets like PageView and ListWheelScrollView to
override the current ScrollBehavior and manage how they are decorated.
The result is a WrappedScrollBehavior, whose fluent setters are Dart’s named
arguments; copying a wrapper flattens it, as Dart’s
_WrappedScrollBehavior.copyWith does.
Trait Implementations§
Source§impl Clone for ScrollBehaviorRef
impl Clone for ScrollBehaviorRef
Source§impl Debug for ScrollBehaviorRef
impl Debug for ScrollBehaviorRef
Source§impl Deref for ScrollBehaviorRef
impl Deref for ScrollBehaviorRef
Source§type Target = dyn ScrollBehavior
type Target = dyn ScrollBehavior
The resulting type after dereferencing.
Source§fn deref(&self) -> &dyn ScrollBehavior
fn deref(&self) -> &dyn ScrollBehavior
Dereferences the value.
Auto Trait Implementations§
impl !RefUnwindSafe for ScrollBehaviorRef
impl !Send for ScrollBehaviorRef
impl !Sync for ScrollBehaviorRef
impl !UnwindSafe for ScrollBehaviorRef
impl Forget for ScrollBehaviorRef
impl Freeze for ScrollBehaviorRefwhere
*const RcInner<dyn ScrollBehavior> is !null: Freeze,
PhantomData<RcInner<dyn ScrollBehavior>>: Freeze,
impl Move for ScrollBehaviorRef
impl Unpin for ScrollBehaviorRef
impl UnsafeUnpin for ScrollBehaviorRefwhere
*const RcInner<dyn ScrollBehavior> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ScrollBehavior>>: UnsafeUnpin,
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