#[non_exhaustive]pub struct DiscoverResult {
pub result_type: ResultType,
pub supported_versions: Vec<ProtocolVersion>,
pub capabilities: ServerCapabilities,
pub instructions: Option<String>,
pub ttl_ms: u64,
pub cache_scope: CacheScope,
pub meta: Option<MetaObject>,
}Expand description
The server’s response to a DiscoverRequest.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.result_type: ResultTypeIdentifies how the result should be parsed.
supported_versions: Vec<ProtocolVersion>Protocol versions implemented by this server.
capabilities: ServerCapabilitiesCapabilities provided by this server.
instructions: Option<String>Optional guidance for using the server.
ttl_ms: u64How long clients may consider this response fresh, in milliseconds.
cache_scope: CacheScopeWhether the cached result may be shared across authorization contexts.
meta: Option<MetaObject>Protocol-level response metadata.
Implementations§
Source§impl DiscoverResult
impl DiscoverResult
Sourcepub fn new(
supported_versions: Vec<ProtocolVersion>,
capabilities: ServerCapabilities,
) -> Self
pub fn new( supported_versions: Vec<ProtocolVersion>, capabilities: ServerCapabilities, ) -> Self
Create a non-cacheable private discovery result.
Sourcepub fn server_info(&self) -> Option<Implementation>
pub fn server_info(&self) -> Option<Implementation>
Return the server implementation information stored in result metadata.
Sourcepub fn set_server_info(&mut self, server_info: Implementation)
pub fn set_server_info(&mut self, server_info: Implementation)
Store server implementation information in result metadata.
Sourcepub fn with_server_info(self, server_info: Implementation) -> Self
pub fn with_server_info(self, server_info: Implementation) -> Self
Store server implementation information in result metadata.
Sourcepub fn from_server_info(
supported_versions: Vec<ProtocolVersion>,
server_info: ServerInfo,
) -> Self
pub fn from_server_info( supported_versions: Vec<ProtocolVersion>, server_info: ServerInfo, ) -> Self
Create a discovery result from the server’s initialization information.
Sourcepub fn with_ttl_ms(self, ttl_ms: u64) -> Self
pub fn with_ttl_ms(self, ttl_ms: u64) -> Self
Set the cache lifetime hint in milliseconds.
Sourcepub fn with_cache_scope(self, cache_scope: CacheScope) -> Self
pub fn with_cache_scope(self, cache_scope: CacheScope) -> Self
Set the cache scope.
Trait Implementations§
Source§impl Clone for DiscoverResult
impl Clone for DiscoverResult
Source§fn clone(&self) -> DiscoverResult
fn clone(&self) -> DiscoverResult
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 moreSource§impl Debug for DiscoverResult
impl Debug for DiscoverResult
Source§impl<'de> Deserialize<'de> for DiscoverResult
impl<'de> Deserialize<'de> for DiscoverResult
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<DiscoverResult> for ServerResult
impl From<DiscoverResult> for ServerResult
Source§fn from(value: DiscoverResult) -> Self
fn from(value: DiscoverResult) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for DiscoverResult
Available on crate feature schemars only.
impl JsonSchema for DiscoverResult
Available on crate feature
schemars only.Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for DiscoverResult
impl PartialEq for DiscoverResult
Source§impl Serialize for DiscoverResult
impl Serialize for DiscoverResult
impl StructuralPartialEq for DiscoverResult
Auto Trait Implementations§
impl Freeze for DiscoverResult
impl RefUnwindSafe for DiscoverResult
impl Send for DiscoverResult
impl Sync for DiscoverResult
impl Unpin for DiscoverResult
impl UnsafeUnpin for DiscoverResult
impl UnwindSafe for DiscoverResult
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