pub struct ProtocolVersion { /* private fields */ }
Expand description
The versions of the sqrl protocol supported by a client/server
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub fn new(versions: &str) -> Result<Self>
pub fn new(versions: &str) -> Result<Self>
Create a new object based on the version string
use sqrl_protocol::ProtocolVersion;
let version = ProtocolVersion::new("1,3,6-10").unwrap();
Sourcepub fn get_max_matching_version(&self, other: &ProtocolVersion) -> Result<u8>
pub fn get_max_matching_version(&self, other: &ProtocolVersion) -> Result<u8>
Compares two protocol version objects, returning the highest version supported by both
use sqrl_protocol::ProtocolVersion;
let version = ProtocolVersion::new("1,3,5,7,9").unwrap();
let version2 = ProtocolVersion::new("2,4,5,8,10").unwrap();
assert_eq!(5, version.get_max_matching_version(&version2).unwrap());
Trait Implementations§
Source§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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