pub struct PortalSession {
pub streams: Vec<PortalStream>,
pub devices: u32,
pub cursor_mode: u32,
pub restore_token: Option<String>,
pub rd_version: u32,
/* private fields */
}Expand description
A started portal session: its streams, the devices it may drive, and the token that restores it without a dialog.
Fields§
§streams: Vec<PortalStream>§devices: u32§cursor_mode: u32§restore_token: Option<String>§rd_version: u32RemoteDesktop interface version, 0 when the session drives no input. ConnectToEIS
exists from version 2.
Implementations§
Source§impl PortalSession
impl PortalSession
Sourcepub fn open(
capture: bool,
devices: u32,
cursor_mode: u32,
restore_token: Option<&str>,
) -> Result<Self, String>
pub fn open( capture: bool, devices: u32, cursor_mode: u32, restore_token: Option<&str>, ) -> Result<Self, String>
Open and start a session. devices (DEVICE_* bits) selects what input the session
drives — zero opens a plain ScreenCast session; capture asks for every monitor as its
own stream with cursor_mode (CURSOR_*), downgraded to what the portal offers. The
call returns once the portal (and any dialog it shows) has answered.
Sourcepub fn probe() -> Result<(), String>
pub fn probe() -> Result<(), String>
Whether a ScreenCast portal answers on the session bus; the error says which step did not, since a bus nobody listens on and a portal without a backend read the same.
Sourcepub fn eis_capable(&self) -> bool
pub fn eis_capable(&self) -> bool
Whether this session can hand out an EIS socket: a RemoteDesktop session (input was
granted) on a backend new enough to carry ConnectToEIS.
Sourcepub fn connect_to_eis(&self) -> Result<OwnedFd, String>
pub fn connect_to_eis(&self) -> Result<OwnedFd, String>
The EIS socket for this session’s seat. A backend that answers hands input over libei
from here on and refuses the Notify* methods, so this is called once, at open, and
only when the injector is committed to.
Sourcepub fn open_pipewire_remote(&self) -> Result<OwnedFd, String>
pub fn open_pipewire_remote(&self) -> Result<OwnedFd, String>
The PipeWire connection the streams live on, opened by the portal with the node permissions of this session.
Sourcepub fn pointer_motion_abs(&self, node: u32, x: f64, y: f64)
pub fn pointer_motion_abs(&self, node: u32, x: f64, y: f64)
Absolute pointer motion in the logical coordinate space of the stream node.
pub fn pointer_motion(&self, dx: f64, dy: f64)
Button by evdev code.
Sourcepub fn pointer_axis(&self, dx: f64, dy: f64, finish: bool)
pub fn pointer_axis(&self, dx: f64, dy: f64, finish: bool)
Smooth scroll by logical pixels, positive down and right as on wl_pointer; finish
closes the scroll series. KDE’s backend negates the vertical axis it is handed and drops
finish (xdg-desktop-portal-kde’s requestPointerAxis, 5.27 through master), where
GNOME’s passes both on, so it is handed the axis negated.
Sourcepub fn pointer_axis_discrete(&self, axis: u32, steps: i32)
pub fn pointer_axis_discrete(&self, axis: u32, steps: i32)
Wheel steps: axis 0 vertical, 1 horizontal.
pub fn keysym(&self, keysym: i32, pressed: bool)
Trait Implementations§
Source§impl Drop for PortalSession
impl Drop for PortalSession
Auto Trait Implementations§
impl !RefUnwindSafe for PortalSession
impl !UnwindSafe for PortalSession
impl Freeze for PortalSession
impl Send for PortalSession
impl Sync for PortalSession
impl Unpin for PortalSession
impl UnsafeUnpin for PortalSession
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> ⓘ
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