Skip to main content

Pane

Struct Pane 

Source
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: Claims

The 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

Source

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.

Source

fn session_of(&self, id: u32) -> Option<String>

Source

fn active_session(&self) -> Option<String>

Source

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.

Source

pub(super) async fn finish(self)

The pane has ended: every window is let go and closed.

Source

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.

Source

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.

Source

fn notice(&mut self, text: String, out: &mut Vec<Out>)

Source

async fn announce(&mut self, out: &mut Vec<Out>)

Tell the pane which windows there are and where the shown one is.

Source

async fn nav_update(&mut self, id: u32, out: &mut Vec<Out>, windows_too: bool)

A window’s address or loading state changed: remember it, tell the pane the windows, and the shown window’s bar.

Source

async fn show(&mut self, id: u32, out: &mut Vec<Out>)

Show id: the screencast moves to it.

Source

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).

Source

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.

Source

async fn close_target(&self, target: &str)

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub(super) async fn on_client(&mut self, text: &str, out: &mut Vec<Out>) -> bool

What a message from the pane means. false ends the pane.

Source

async fn on_client_at( &mut self, text: &str, out: &mut Vec<Out>, now: Instant, ) -> bool

on_client at now (the clock is an argument so a test can say how long after a change a key arrives).

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more