Struct Version

Source
pub struct Version {
    pub major: u32,
    pub minor: u32,
    pub patch: u32,
    pub release_date: u32,
    pub ffi_api: u32,
    pub string: String,
}
Expand description

Information about the library version

Fields§

§major: u32

The major version of the library

§minor: u32

The minor version of the library

§patch: u32

The patch version of the library

§release_date: u32

The release date of the library, as YYYYMMDD, for example 2.7.0 has value 20180702. Will be 0 for unreleased versions.

§ffi_api: u32

The version of the FFI API, as a YYYYMMDD field.

§string: String

A free-form string describing the library version

Implementations§

Source§

impl Version

Source

pub fn current() -> Result<Version>

Read the version information of the currently linked lib

Source

pub fn at_least(&self, major: u32, minor: u32) -> bool

Return true if the current version is at least as high as the major and minor numbers passed as arguments

Source

pub fn supports_version(version: u32) -> bool

Return true if the specified API version is supported by this version of the library.

§Examples
assert_eq!(botan::Version::supports_version(42), false);
assert_eq!(botan::Version::supports_version(20180713), true);

Trait Implementations§

Source§

impl Debug for Version

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.