pub struct RemoteActionFrame {
pub version: u16,
pub message: RemoteActionMessage,
pub workspace: Option<String>,
pub press: Option<u32>,
pub press_at: Option<PressPoint>,
}Expand description
A versioned RemoteActionMessage, the unit a transport carries.
The encoding is self-describing JSON: action arguments and outputs are open JSON values, and a server forwarding the bytes need not understand them.
Fields§
§version: u16§message: RemoteActionMessage§workspace: Option<String>The workspace the request is asked in, on a transport that serves every workspace its
device holds (the daemon’s native endpoint), as a shell link’s call names its own: none
asks in the device’s own. A read names its workspace in its address instead
(Self::workspace).
press: Option<u32>The input serial the person’s press that ran this request travelled with, as the compositor issued it to the window the app’s connection is: what a host checks to admit the request as the person, once. Only an app whose window received the press can name it: a synthetic or replayed serial proves nothing, and a request naming none followed no press. It is transport, never part of the invocation’s identity.
press_at: Option<PressPoint>Where in the window the control that press answered stands, as the window says of a key
press (press_points): what the person’s question stands at when the compositor’s
record of the press has no point. Like press, transport only.
Implementations§
Source§impl RemoteActionFrame
impl RemoteActionFrame
Sourcepub const fn new(message: RemoteActionMessage) -> Self
pub const fn new(message: RemoteActionMessage) -> Self
Wrap message at this build’s REMOTE_ACTIONS_VERSION.
Sourcepub fn pressed(self, press: Option<u32>) -> Self
pub fn pressed(self, press: Option<u32>) -> Self
The same request, asked by the person’s press the compositor issued serial with, and
carrying where the control it answered stands when its window said.
Sourcepub fn in_workspace(self, workspace: Option<String>) -> Self
pub fn in_workspace(self, workspace: Option<String>) -> Self
The same request, asked in workspace (none: the device’s own).
Sourcepub fn workspace(&self) -> Option<&str>
pub fn workspace(&self) -> Option<&str>
The workspace the request is asked in: the one a read’s address names, else the one the
frame names; None for the device’s own.
Sourcepub fn encode(&self) -> Result<Vec<u8>, RemoteFrameError>
pub fn encode(&self) -> Result<Vec<u8>, RemoteFrameError>
Encode for a transport.
§Errors
Returns RemoteFrameError::TooLarge past
MAX_REMOTE_ACTION_FRAME_BYTES, or Malformed if a value cannot
be encoded.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, RemoteFrameError>
pub fn decode(bytes: &[u8]) -> Result<Self, RemoteFrameError>
Decode bytes from a transport. The version is checked before the message, so a frame from a newer peer is refused by version rather than misread.
Trait Implementations§
Source§impl Clone for RemoteActionFrame
impl Clone for RemoteActionFrame
Source§impl Debug for RemoteActionFrame
impl Debug for RemoteActionFrame
Source§impl<'de> Deserialize<'de> for RemoteActionFrame
impl<'de> Deserialize<'de> for RemoteActionFrame
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RemoteActionFrame
impl PartialEq for RemoteActionFrame
Source§impl Serialize for RemoteActionFrame
impl Serialize for RemoteActionFrame
impl StructuralPartialEq for RemoteActionFrame
Auto Trait Implementations§
impl Forget for RemoteActionFrame
impl Freeze for RemoteActionFrame
impl Move for RemoteActionFrame
impl RefUnwindSafe for RemoteActionFrame
impl Send for RemoteActionFrame
impl Sync for RemoteActionFrame
impl Unpin for RemoteActionFrame
impl UnsafeUnpin for RemoteActionFrame
impl UnwindSafe for RemoteActionFrame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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