#[non_exhaustive]pub struct Cle {
pub events: Vec<CleEvent>,
pub definitions: Option<CleDefinitions>,
}Expand description
TEA projection of CLE events. This is not a full ECMA-428 document.
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.events: Vec<CleEvent>Events.
definitions: Option<CleDefinitions>Definitions.
Implementations§
Source§impl Cle
impl Cle
Sourcepub fn status_for_semver(&self, version: &Version) -> LifecycleStatus
pub fn status_for_semver(&self, version: &Version) -> LifecycleStatus
The lifecycle status of version, comparing versions as SemVer 2.0.
Experimental: may change in a 0.x minor release.
use libtea_core::Cle;
let cle: Cle = serde_json::from_str(r#"{"events": [
{"id": 3, "type": "endOfLife", "effective": "2026-01-01T00:00:00Z",
"published": "2025-01-01T00:00:00Z", "versions": [{"range": "vers:semver/<2.0.0"}]},
{"id": 2, "type": "endOfSupport", "effective": "2025-06-01T00:00:00Z",
"published": "2025-01-01T00:00:00Z", "versions": [{"range": "vers:pypi/<2.0"}]},
{"id": 1, "type": "released", "effective": "2024-01-01T00:00:00Z",
"published": "2024-01-01T00:00:00Z", "version": "1.4.0"}
]}"#).unwrap();
let status = cle.status_for_semver(&semver::Version::new(1, 4, 0));
assert_eq!(status.end_of_life.unwrap().as_str(), "2026-01-01T00:00:00Z");
assert_eq!(status.released.unwrap().as_str(), "2024-01-01T00:00:00Z");
// Not "no end of support": the range could not be evaluated as SemVer.
assert!(status.end_of_support.is_none());
assert_eq!(status.unevaluated.len(), 1);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cle
impl<'de> Deserialize<'de> for Cle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Cle
impl StructuralPartialEq for Cle
Auto Trait Implementations§
impl Forget for Cle
impl Freeze for Cle
impl Move for Cle
impl RefUnwindSafe for Cle
impl Send for Cle
impl Sync for Cle
impl Unpin for Cle
impl UnsafeUnpin for Cle
impl UnwindSafe for Cle
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