feat: add modern client lifecycle modes (SEP-2575) (#995)
* feat: add modern client lifecycle modes * refactor: drop modern naming and dead cleanup * fix: gate request metadata on inline lifecycle only
This commit is contained in:
parent
81745f1375
commit
2e2c79173c
1 changed files with 1525 additions and 306 deletions
|
|
@ -439,6 +439,19 @@ impl RequestMetaObject {
|
|||
meta
|
||||
}
|
||||
|
||||
/// Create request metadata with the client context SEP-2575 requires on every request.
|
||||
pub fn with_client_context(
|
||||
protocol_version: ProtocolVersion,
|
||||
client_info: Implementation,
|
||||
client_capabilities: ClientCapabilities,
|
||||
) -> Self {
|
||||
let mut meta = Self::new();
|
||||
meta.set_protocol_version(protocol_version);
|
||||
meta.set_client_info(client_info);
|
||||
meta.set_client_capabilities(client_capabilities);
|
||||
meta
|
||||
}
|
||||
|
||||
pub(crate) fn static_empty() -> &'static Self {
|
||||
static EMPTY: std::sync::OnceLock<RequestMetaObject> = std::sync::OnceLock::new();
|
||||
EMPTY.get_or_init(Default::default)
|
||||
|
|
|
|||
Loading…
Reference in a new issue