pub enum ServerRequest {
CmdExecApproval(CommandExecutionRequestApprovalParams),
FileChangeApproval(FileChangeRequestApprovalParams),
ToolRequestUserInput(ToolRequestUserInputParams),
McpServerElicitationRequest(McpServerElicitationRequestParams),
PermissionsRequestApproval(PermissionsRequestApprovalParams),
ItemToolCall(DynamicToolCallParams),
ChatgptAuthTokensRefresh(ChatgptAuthTokensRefreshParams),
AttestationGenerate(AttestationGenerateParams),
ApplyPatchApproval(ApplyPatchApprovalParams),
ExecCommandApproval(ExecCommandApprovalParams),
Unknown {
method: String,
params: Option<Value>,
},
}Expand description
A server-to-client request that requires a response (approval flow).
The wire envelope carries an id for response correlation; that id is
held alongside this enum in ServerMessage::Request rather than embedded
inside the variant, since responding doesn’t depend on which approval-type
was requested.
Variants§
CmdExecApproval(CommandExecutionRequestApprovalParams)
item/commandExecution/requestApproval
FileChangeApproval(FileChangeRequestApprovalParams)
item/fileChange/requestApproval
ToolRequestUserInput(ToolRequestUserInputParams)
item/tool/requestUserInput
McpServerElicitationRequest(McpServerElicitationRequestParams)
mcpServer/elicitation/request
PermissionsRequestApproval(PermissionsRequestApprovalParams)
item/permissions/requestApproval
ItemToolCall(DynamicToolCallParams)
item/tool/call
ChatgptAuthTokensRefresh(ChatgptAuthTokensRefreshParams)
account/chatgptAuthTokens/refresh
AttestationGenerate(AttestationGenerateParams)
attestation/generate
ApplyPatchApproval(ApplyPatchApprovalParams)
applyPatchApproval
ExecCommandApproval(ExecCommandApprovalParams)
execCommandApproval
Unknown
A request method this crate version does not yet model.
Implementations§
Source§impl ServerRequest
impl ServerRequest
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
true if this request’s method isn’t modeled by the crate.
Sourcepub fn from_envelope(method: &str, params: Option<Value>) -> Result<Self, Error>
pub fn from_envelope(method: &str, params: Option<Value>) -> Result<Self, Error>
Construct a ServerRequest from a method + params envelope.
Trait Implementations§
Source§impl Clone for ServerRequest
impl Clone for ServerRequest
Source§fn clone(&self) -> ServerRequest
fn clone(&self) -> ServerRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerRequest
impl RefUnwindSafe for ServerRequest
impl Send for ServerRequest
impl Sync for ServerRequest
impl Unpin for ServerRequest
impl UnsafeUnpin for ServerRequest
impl UnwindSafe for ServerRequest
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