pub(super) struct Pane {
cdp: Arc<Cdp>,
windows: Windows,
state: HashMap<u32, PageState>,
size: (u32, u32),
events: WeakUnboundedSender<(u32, Event)>,
targets: UnboundedSender<TargetEvent>,
claims: Claims,
limiter: NoticeLimiter,
keys_held_until: Option<Instant>,
}Fields§
§cdp: Arc<Cdp>§windows: Windows§state: HashMap<u32, PageState>§size: (u32, u32)§events: WeakUnboundedSender<(u32, Event)>Where the events of a window’s session go, tagged with the window. Weak: when the browser goes, every session’s end drops the last strong sender and the pane’s queue ends with it.
targets: UnboundedSender<TargetEvent>Where the browser’s news of this pane’s windows is told (popups).
claims: ClaimsThe pages this pane has claimed: released with the pane, however it ends.
limiter: NoticeLimiter§keys_held_until: Option<Instant>Keys are dropped until then: the shown window just changed and the person did not choose it (windows::KEY_GAP).
Implementations§
Source§impl Pane
impl Pane
Sourcepub(super) async fn open(
cdp: &Arc<Cdp>,
start: &Start,
) -> Result<(Pane, UnboundedReceiver<(u32, Event)>, UnboundedReceiver<TargetEvent>), String>
pub(super) async fn open( cdp: &Arc<Cdp>, start: &Start, ) -> Result<(Pane, UnboundedReceiver<(u32, Event)>, UnboundedReceiver<TargetEvent>), String>
The pane’s first window: a page made for it, switched on and sent to its first address. Closed again if it cannot be made ready.
fn session_of(&self, id: u32) -> Option<String>
fn active_session(&self) -> Option<String>
Sourceasync fn prepare(&self, id: u32, url: Option<&str>) -> Result<(), String>
async fn prepare(&self, id: u32, url: Option<&str>) -> Result<(), String>
Switch a window on: events, the viewport, focus, the screencast and, for the first window, its first address.
Sourcefn hold_keys(&mut self, now: Instant)
fn hold_keys(&mut self, now: Instant)
The shown window changed and the person did not choose it: keys are held back for a moment, so one typed for the window they were looking at does not land in another.
Sourcefn say_moved(&mut self, id: u32, out: &mut Vec<Out>)
fn say_moved(&mut self, id: u32, out: &mut Vec<Out>)
The person comes back to id: if it went to another site while it was not shown, say which.
fn notice(&mut self, text: String, out: &mut Vec<Out>)
Sourceasync fn announce(&mut self, out: &mut Vec<Out>)
async fn announce(&mut self, out: &mut Vec<Out>)
Tell the pane which windows there are and where the shown one is.
A window’s address or loading state changed: remember it, tell the pane the windows, and the shown window’s bar.
Sourceasync fn forget(&mut self, id: u32, chosen: bool, out: &mut Vec<Out>) -> bool
async fn forget(&mut self, id: u32, chosen: bool, out: &mut Vec<Out>) -> bool
A window ended (or was closed): it is let go, and when it was the shown one the window that opened it is shown again.
False when it was the pane’s first, which ends the pane. chosen is whether the person closed it (else it closed itself or
crashed, and the window that is shown now was not their choice).
Sourcepub(super) async fn on_target(
&mut self,
event: TargetEvent,
out: &mut Vec<Out>,
) -> bool
pub(super) async fn on_target( &mut self, event: TargetEvent, out: &mut Vec<Out>, ) -> bool
The browser’s news of this pane’s windows. false ends the pane.
async fn close_target(&self, target: &str)
Sourceasync fn opened(
&mut self,
target: &str,
opener_target: &str,
url: &str,
out: &mut Vec<Out>,
)
async fn opened( &mut self, target: &str, opener_target: &str, url: &str, out: &mut Vec<Out>, )
A page of this pane opened a window: it is shown, unless the pane already shows as many as it may.
Sourcepub(super) async fn on_event(
&mut self,
id: u32,
event: Event,
out: &mut Vec<Out>,
) -> bool
pub(super) async fn on_event( &mut self, id: u32, event: Event, out: &mut Vec<Out>, ) -> bool
What a window’s event means for the pane. false ends the pane.
Sourcefn frame(&mut self, id: u32, params: &Value, out: &mut Vec<Out>)
fn frame(&mut self, id: u32, params: &Value, out: &mut Vec<Out>)
A screencast frame: the shown window’s goes to the pane; another window’s is acknowledged and dropped.
Sourceasync fn resize(&mut self, w: u32, h: u32) -> Result<(), String>
async fn resize(&mut self, w: u32, h: u32) -> Result<(), String>
Resize every window and make the browser send a frame of the new size even when the page does not change: stopping and starting the screencast does that.
Auto Trait Implementations§
impl Freeze for Pane
impl RefUnwindSafe for Pane
impl Send for Pane
impl Sync for Pane
impl Unpin for Pane
impl UnsafeUnpin for Pane
impl UnwindSafe for Pane
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> 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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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