pub struct ResourceRequestParams {
pub channel: Uri,
pub uri: Uri,
pub read: Option<bool>,
pub write: Option<bool>,
}Expand description
Requests permission to access a resource on the receiver’s filesystem.
resourceRequest is symmetrical and MAY be sent in either direction: a
client asks the server to grant access to a server-side resource, or a
server asks the client to grant access to a client-side resource. The
receiver decides whether to allow, deny, or prompt the user for the
requested access.
If the receiver denies access, it MUST respond with PermissionDenied
(-32009). The error data MAY include a ResourceRequestParams value
describing the access the caller would need to be granted for the
operation to succeed; see PermissionDeniedErrorData in
types/errors.ts.
After a successful resourceRequest, the caller MAY use the corresponding
resource* commands (e.g. resourceRead, resourceWrite) to perform the
operation. Receivers MAY rescind access at any time by returning
PermissionDenied on subsequent operations.
Either read, write, or both SHOULD be set to true. A request with
neither flag set is treated as read: true by receivers.
Fields§
§channel: UriChannel URI this command targets.
uri: UriResource URI being requested. Typically a file: URI on the receiver’s
filesystem, but any URI scheme that the receiver mediates access to is
allowed.
read: Option<bool>Whether the caller needs read access to the resource.
write: Option<bool>Whether the caller needs write access to the resource.
Trait Implementations§
Source§impl Clone for ResourceRequestParams
impl Clone for ResourceRequestParams
Source§fn clone(&self) -> ResourceRequestParams
fn clone(&self) -> ResourceRequestParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceRequestParams
impl Debug for ResourceRequestParams
Source§impl<'de> Deserialize<'de> for ResourceRequestParams
impl<'de> Deserialize<'de> for ResourceRequestParams
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 ResourceRequestParams
impl PartialEq for ResourceRequestParams
Source§fn eq(&self, other: &ResourceRequestParams) -> bool
fn eq(&self, other: &ResourceRequestParams) -> bool
self and other values to be equal, and is used by ==.