pub struct Discovered { /* private fields */ }Available on crate feature
client only.Expand description
Step 1: the peer’s supported versions are known.
Implementations§
Source§impl Discovered
impl Discovered
Sourcepub fn versions(&self) -> &[Version]
pub fn versions(&self) -> &[Version]
Every version the peer advertised, including ones this crate cannot speak.
Sourcepub fn best_common_version(&self) -> Option<&Version>
pub fn best_common_version(&self) -> Option<&Version>
The newest version both sides can speak.
Sourcepub async fn select_best(
self,
transport: &Transport,
) -> Result<Selected, OcpiError>
pub async fn select_best( self, transport: &Transport, ) -> Result<Selected, OcpiError>
GET the details of the newest version both sides support.
§Errors
Returns OcpiError::Remote with 3002 Unsupported version when there is no version in
common — which is exactly the code the specification reserves for it.
Sourcepub async fn select(
self,
transport: &Transport,
version: &VersionNumber,
) -> Result<Selected, OcpiError>
pub async fn select( self, transport: &Transport, version: &VersionNumber, ) -> Result<Selected, OcpiError>
GET the details of a specific version.
§Errors
Returns OcpiError::Remote with 3002 when the peer does not offer that version.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Discovered
impl RefUnwindSafe for Discovered
impl Send for Discovered
impl Sync for Discovered
impl Unpin for Discovered
impl UnsafeUnpin for Discovered
impl UnwindSafe for Discovered
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