#[non_exhaustive]pub struct DiscoveryInfo {
pub product_release: ProductReleaseId,
pub servers: Vec<DiscoveryServer>,
}Expand description
One resolved product release from /discovery.
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.product_release: ProductReleaseIdProduct release UUID.
servers: Vec<DiscoveryServer>Servers that can serve that release.
Implementations§
Source§impl DiscoveryInfo
impl DiscoveryInfo
Sourcepub fn parse_list(bytes: &[u8]) -> Result<Vec<Self>, ModelError>
pub fn parse_list(bytes: &[u8]) -> Result<Vec<Self>, ModelError>
Parse a successful /discovery body.
An empty array is rejected. The specification requires 404 with a TEA
error body when the identifier does not resolve, not 200 [].
§Errors
Returns an error when the body is not a non-empty array of discovery objects.
Sourcepub fn parse_list_lenient(bytes: &[u8]) -> Result<Vec<Self>, ModelError>
pub fn parse_list_lenient(bytes: &[u8]) -> Result<Vec<Self>, ModelError>
Like Self::parse_list, but also accepts short API versions such as
1 and 1.0 (see ApiVersion::parse_lenient).
§Errors
Returns an error when the body is not a non-empty array of discovery objects.
Sourcepub fn select_server(
&self,
supported: &SupportedApi,
) -> Result<Vec<SelectedEndpoint>, ModelError>
pub fn select_server( &self, supported: &SupportedApi, ) -> Result<Vec<SelectedEndpoint>, ModelError>
Order this release’s servers for later API calls.
§Errors
Returns an error when none advertise a supported version.
Trait Implementations§
Source§impl Clone for DiscoveryInfo
impl Clone for DiscoveryInfo
Source§impl Debug for DiscoveryInfo
impl Debug for DiscoveryInfo
impl Eq for DiscoveryInfo
Source§impl PartialEq for DiscoveryInfo
impl PartialEq for DiscoveryInfo
impl StructuralPartialEq for DiscoveryInfo
Auto Trait Implementations§
impl Forget for DiscoveryInfo
impl Freeze for DiscoveryInfo
impl Move for DiscoveryInfo
impl RefUnwindSafe for DiscoveryInfo
impl Send for DiscoveryInfo
impl Sync for DiscoveryInfo
impl Unpin for DiscoveryInfo
impl UnsafeUnpin for DiscoveryInfo
impl UnwindSafe for DiscoveryInfo
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