Struct View
pub struct View {
pub scroll: Vec<f64>,
pub focus: Option<FocusView>,
pub open_resource: Option<String>,
pub viewport: ViewRect,
pub view_mode: Option<String>,
}Expand description
A participant’s View: everything about where they are looking that is
never merged into anyone else’s. Every field derives
Serialize/Deserialize so a future presence layer can broadcast any
subset. View::default is “top of the document, nothing focused, no
resource” — the correct starting point for a freshly-launched app.
Fields§
§scroll: Vec<f64>Scroll offset(s) of the app’s scrollable content.
focus: Option<FocusView>The focused widget’s caret/selection, or None when nothing is focused.
open_resource: Option<String>The id of the resource currently open (a record id), or None.
viewport: ViewRectThe viewport rect in physical pixels at capture time.
view_mode: Option<String>The current view mode, if the app has one.
Implementations§
§impl View
impl View
pub fn capture(app: &App) -> View
pub fn capture(app: &App) -> View
Capture the live App’s presentation into a View.
Thin front door for FreezeThaw::capture_view so callers can write
the natural View::capture(&app).
pub fn restore(&self, app: &mut App)
pub fn restore(&self, app: &mut App)
Write this View back onto a live App: move focus
and restore the caret, hand the scroll/view-mode fields to the root
widget. The counterpart to View::capture.
Trait Implementations§
§impl<'de> Deserialize<'de> for View
impl<'de> Deserialize<'de> for View
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<View, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<View, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for View
impl Serialize for View
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for View
Auto Trait Implementations§
impl Freeze for View
impl RefUnwindSafe for View
impl Send for View
impl Sync for View
impl Unpin for View
impl UnsafeUnpin for View
impl UnwindSafe for View
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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> DowncastSync for T
impl<T> DowncastSync for T
§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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more