pub struct CanIUse { /* private fields */ }Expand description
A database of data relating to caniuse.com Not used directly, but references should be passed to methods on AgentName, FeatureName, EraName, and, less usefully, Status and ParentCategory.
Implementations§
Source§impl CanIUse
impl CanIUse
Sourcepub fn from_path<P: AsRef<Path>>(
can_i_use_database_file_path: P,
) -> Result<Self, Box<dyn Error>>
pub fn from_path<P: AsRef<Path>>( can_i_use_database_file_path: P, ) -> Result<Self, Box<dyn Error>>
Deserialize a CanIUse database from a file path to a data-2.0.json file (typically in fulldata-json/).
Sourcepub fn from_reader<R: Read>(
reader_of_stream_of_can_i_use_json_bytes: R,
) -> Result<Self, Box<dyn Error>>
pub fn from_reader<R: Read>( reader_of_stream_of_can_i_use_json_bytes: R, ) -> Result<Self, Box<dyn Error>>
Deserialize a CanIUse database from a readable stream of raw JSON bytes.
Sourcepub fn from_slice(raw_can_i_use_json_bytes: &[u8]) -> Result<Self, Error>
pub fn from_slice(raw_can_i_use_json_bytes: &[u8]) -> Result<Self, Error>
Deserialize a CanIUse database from a slice of raw JSON bytes.
Sourcepub fn last_updated(&self) -> DateTime<Utc>
pub fn last_updated(&self) -> DateTime<Utc>
A timestamp of when this particular database was last updated.
Sourcepub fn known_agent_names(&self) -> AgentNameIterator<'_> ⓘ
pub fn known_agent_names(&self) -> AgentNameIterator<'_> ⓘ
An iterator over the AgentNames known in this caniuse.com database
Sourcepub fn known_statuses(&self) -> StatusIterator<'_> ⓘ
pub fn known_statuses(&self) -> StatusIterator<'_> ⓘ
An iterator over the AgentNames known in this caniuse.com database
Sourcepub fn known_parent_categories(&self) -> ParentCategoryIterator<'_> ⓘ
pub fn known_parent_categories(&self) -> ParentCategoryIterator<'_> ⓘ
An iterator over the AgentNames known in this caniuse.com database
Sourcepub fn known_feature_names(&self) -> FeatureNameIterator<'_> ⓘ
pub fn known_feature_names(&self) -> FeatureNameIterator<'_> ⓘ
An iterator over the AgentNames known in this caniuse.com database
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CanIUse
impl<'de> Deserialize<'de> for CanIUse
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
Auto Trait Implementations§
impl Freeze for CanIUse
impl RefUnwindSafe for CanIUse
impl Send for CanIUse
impl Sync for CanIUse
impl Unpin for CanIUse
impl UnwindSafe for CanIUse
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