pub struct View<V> {
pub model: Model<V>,
}
Fields§
§model: Model<V>
Implementations§
source§impl<V: 'static> View<V>
impl<V: 'static> View<V>
sourcepub fn downgrade(&self) -> WeakView<V>
pub fn downgrade(&self) -> WeakView<V>
Convert this strong view reference into a weak view reference.
pub fn update<C, R>( &self, cx: &mut C, f: impl FnOnce(&mut V, &mut ViewContext<'_, V>) -> R ) -> C::Result<R>where C: VisualContext,
pub fn read<'a>(&self, cx: &'a AppContext) -> &'a V
pub fn focus_handle(&self, cx: &AppContext) -> FocusHandlewhere V: FocusableView,
Trait Implementations§
source§impl<V> PartialEq<View<V>> for View<V>
impl<V> PartialEq<View<V>> for View<V>
source§impl<V: 'static + Render> RenderOnce for View<V>
impl<V: 'static + Render> RenderOnce for View<V>
type Element = View<V>
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
impl<V> Eq for View<V>
Auto Trait Implementations§
impl<V> !RefUnwindSafe for View<V>
impl<V> Send for View<V>
impl<V> Sync for View<V>
impl<V> Unpin for View<V>where V: Unpin,
impl<V> !UnwindSafe for View<V>
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.