pub struct BubbleState {
visibility: Mutex<BubbleVisibility>,
last_position: Mutex<Option<BubblePosition>>,
}Expand description
Tauri-managed state for the webcam-bubble window (M-BUBBLE.0 / AUT-273 + M-BUBBLE.3 / AUT-276). Tracks both the visibility state machine and the in-memory last-known position so position persistence survives hide/show cycles.
last_position = None means “no remembered position — first-show
will compute a sensible default.” Once set (either by loading from
disk on first show, by WindowEvent::Moved mid-session, or by
set_last_position for tests), the value is the source of truth
for the next show.
Fields§
§visibility: Mutex<BubbleVisibility>§last_position: Mutex<Option<BubblePosition>>Implementations§
Source§impl BubbleState
impl BubbleState
Sourcepub fn last_position(&self) -> Option<BubblePosition>
pub fn last_position(&self) -> Option<BubblePosition>
Snapshot the current remembered position (or None if unset).
Used by the WindowEvent::Moved handler in main.rs to keep
the in-memory cache fresh during drags.
Sourcepub fn set_last_position(&self, pos: BubblePosition)
pub fn set_last_position(&self, pos: BubblePosition)
Replace the remembered position. Cheap (one mutex acquire + an
i32 pair copy) so safe to call on every WindowEvent::Moved.
Trait Implementations§
Source§impl Default for BubbleState
impl Default for BubbleState
Source§fn default() -> BubbleState
fn default() -> BubbleState
Auto Trait Implementations§
impl !Freeze for BubbleState
impl RefUnwindSafe for BubbleState
impl Send for BubbleState
impl Sync for BubbleState
impl Unpin for BubbleState
impl UnsafeUnpin for BubbleState
impl UnwindSafe for BubbleState
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
§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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().