pub struct ControlResponse {
pub response: ControlResponsePayload,
}Expand description
Control response to CLI
Built using the ergonomic methods on ToolPermissionRequest or
constructed directly for other control request types.
Fields§
§response: ControlResponsePayloadThe request ID this response corresponds to
Implementations§
Source§impl ControlResponse
impl ControlResponse
Sourcepub fn from_result(request_id: &str, result: PermissionResult) -> Self
pub fn from_result(request_id: &str, result: PermissionResult) -> Self
Create a success response from a PermissionResult
This is the preferred way to construct permission responses.
Sourcepub fn success(request_id: &str, response_data: Value) -> Self
pub fn success(request_id: &str, response_data: Value) -> Self
Create a success response with the given payload (raw Value)
Sourcepub fn success_empty(request_id: &str) -> Self
pub fn success_empty(request_id: &str) -> Self
Create an empty success response (for acks)
Trait Implementations§
Source§impl Clone for ControlResponse
impl Clone for ControlResponse
Source§fn clone(&self) -> ControlResponse
fn clone(&self) -> ControlResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ControlResponse
impl Debug for ControlResponse
Source§impl<'de> Deserialize<'de> for ControlResponse
impl<'de> Deserialize<'de> for ControlResponse
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ControlResponse> for ControlResponseMessage
impl From<ControlResponse> for ControlResponseMessage
Source§fn from(resp: ControlResponse) -> Self
fn from(resp: ControlResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ControlResponse
impl RefUnwindSafe for ControlResponse
impl Send for ControlResponse
impl Sync for ControlResponse
impl Unpin for ControlResponse
impl UnwindSafe for ControlResponse
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
Mutably borrows from an owned value. Read more