chore: add #[non_exhaustive] to remaining public structs (#768)
* chore: add #[non_exhaustive] to remaining public structs * chore: add #[non_exhaustive] to remaining public types * chore: enable exhaustive_structs/enums clippy lints * test: add untagged ServerResult deserialization regression tests
This commit is contained in:
parent
ee1c63c53f
commit
6a3b32d3ab
1 changed files with 430 additions and 211 deletions
|
|
@ -30,6 +30,7 @@ use crate::{
|
|||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub struct StreamableHttpServerConfig {
|
||||
/// The ping message duration for SSE connections.
|
||||
pub sse_keep_alive: Option<Duration>,
|
||||
|
|
@ -62,6 +63,33 @@ impl Default for StreamableHttpServerConfig {
|
|||
}
|
||||
}
|
||||
|
||||
impl StreamableHttpServerConfig {
|
||||
pub fn with_sse_keep_alive(mut self, duration: Option<Duration>) -> Self {
|
||||
self.sse_keep_alive = duration;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_sse_retry(mut self, duration: Option<Duration>) -> Self {
|
||||
self.sse_retry = duration;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_stateful_mode(mut self, stateful: bool) -> Self {
|
||||
self.stateful_mode = stateful;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_json_response(mut self, json_response: bool) -> Self {
|
||||
self.json_response = json_response;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_cancellation_token(mut self, token: CancellationToken) -> Self {
|
||||
self.cancellation_token = token;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::result_large_err,
|
||||
reason = "BoxResponse is intentionally large; matches other handlers in this file"
|
||||
|
|
|
|||
Loading…
Reference in a new issue