pub struct PhpVersion { /* private fields */ }Expand description
Lightweight PHP version metadata.
Implementations§
Source§impl PhpVersion
impl PhpVersion
pub fn new( major: u16, minor: Option<u16>, patch: Option<u16>, ) -> Result<PhpVersion, PhpVersionParseError>
pub const fn major(&self) -> u16
pub const fn minor(&self) -> Option<u16>
pub const fn patch(&self) -> Option<u16>
pub fn suffix(&self) -> Option<&str>
pub const fn is_php8_or_newer(&self) -> bool
Trait Implementations§
Source§impl Clone for PhpVersion
impl Clone for PhpVersion
Source§fn clone(&self) -> PhpVersion
fn clone(&self) -> PhpVersion
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 PhpVersion
impl Debug for PhpVersion
Source§impl Display for PhpVersion
impl Display for PhpVersion
Source§impl FromStr for PhpVersion
impl FromStr for PhpVersion
Source§type Err = PhpVersionParseError
type Err = PhpVersionParseError
The associated error which can be returned from parsing.
Source§fn from_str(input: &str) -> Result<PhpVersion, <PhpVersion as FromStr>::Err>
fn from_str(input: &str) -> Result<PhpVersion, <PhpVersion as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for PhpVersion
impl Hash for PhpVersion
Source§impl Ord for PhpVersion
impl Ord for PhpVersion
Source§fn cmp(&self, other: &PhpVersion) -> Ordering
fn cmp(&self, other: &PhpVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PhpVersion
impl PartialEq for PhpVersion
Source§fn eq(&self, other: &PhpVersion) -> bool
fn eq(&self, other: &PhpVersion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PhpVersion
impl PartialOrd for PhpVersion
impl Eq for PhpVersion
impl StructuralPartialEq for PhpVersion
Auto Trait Implementations§
impl Freeze for PhpVersion
impl RefUnwindSafe for PhpVersion
impl Send for PhpVersion
impl Sync for PhpVersion
impl Unpin for PhpVersion
impl UnsafeUnpin for PhpVersion
impl UnwindSafe for PhpVersion
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