Struct ViewSubset
pub struct ViewSubset {
pub scroll: Vec<f64>,
pub open_resource: Option<String>,
pub viewport: ViewRect,
pub view_mode: Option<String>,
}Expand description
The broadcastable subset of a View — the region and resource a
participant is looking at, minus the caret/selection.
Deliberately small and self-describing so it can travel inside the
existing presence frame; it’s what an attach/follow binds the local
viewport to. The caret (View::focus) is intentionally excluded: it
already has a dedicated presence payload (Caret/Selection) landing in
the per-key caret maps, so re-sending it here would double-broadcast and
re-key it away from the widget scopes those renderers read.
Fields§
§scroll: Vec<f64>Scroll offset(s) of the participant’s scrollable content.
open_resource: Option<String>The resource the participant currently has open, if any.
viewport: ViewRectThe participant’s viewport rect in physical pixels.
view_mode: Option<String>The participant’s current view mode, if the app has one.
Implementations§
§impl ViewSubset
impl ViewSubset
pub fn from_view(view: &View) -> ViewSubset
pub fn from_view(view: &View) -> ViewSubset
Project a full View onto the subset presence broadcasts. Drops
View::focus (broadcast separately as caret/selection presence).
Trait Implementations§
§impl Clone for ViewSubset
impl Clone for ViewSubset
§fn clone(&self) -> ViewSubset
fn clone(&self) -> ViewSubset
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ViewSubset
impl Debug for ViewSubset
§impl Default for ViewSubset
impl Default for ViewSubset
§fn default() -> ViewSubset
fn default() -> ViewSubset
§impl<'de> Deserialize<'de> for ViewSubset
impl<'de> Deserialize<'de> for ViewSubset
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ViewSubset, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ViewSubset, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for ViewSubset
impl PartialEq for ViewSubset
§impl Serialize for ViewSubset
impl Serialize for ViewSubset
§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 ViewSubset
Auto Trait Implementations§
impl Freeze for ViewSubset
impl RefUnwindSafe for ViewSubset
impl Send for ViewSubset
impl Sync for ViewSubset
impl Unpin for ViewSubset
impl UnsafeUnpin for ViewSubset
impl UnwindSafe for ViewSubset
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