pub struct SnapshotIdentifier {
pub language: String,
pub project: String,
pub namespace: u32,
}Expand description
Snapshot identifier: {language}{project}namespace{number}
§Examples
use wme_models::SnapshotIdentifier;
// Create from components
let id = SnapshotIdentifier::new("en", "wiki", 0);
assert_eq!(id.to_string(), "enwiki_namespace_0");
// Parse from string
let id: SnapshotIdentifier = "enwiki_namespace_0".parse().unwrap();
assert_eq!(id.language, "en");
assert_eq!(id.project, "wiki");
assert_eq!(id.namespace, 0);
// Use predefined constants
let enwiki = SnapshotIdentifier::enwiki_namespace_0();
let dewiki = SnapshotIdentifier::dewiki_namespace_0();Fields§
§language: StringLanguage code (e.g., “en”, “de”)
project: StringProject code (e.g., “wiki”, “wiktionary”)
namespace: u32Namespace number
Implementations§
Source§impl SnapshotIdentifier
impl SnapshotIdentifier
Sourcepub fn new(language: &str, project: &str, namespace: u32) -> Self
pub fn new(language: &str, project: &str, namespace: u32) -> Self
Create a new snapshot identifier.
§Examples
use wme_models::SnapshotIdentifier;
let id = SnapshotIdentifier::new("fr", "wiki", 0);
assert_eq!(id.to_string(), "frwiki_namespace_0");Sourcepub fn enwiki_namespace_0() -> Self
pub fn enwiki_namespace_0() -> Self
English Wikipedia articles (namespace 0).
Sourcepub fn dewiki_namespace_0() -> Self
pub fn dewiki_namespace_0() -> Self
German Wikipedia articles.
Trait Implementations§
Source§impl Clone for SnapshotIdentifier
impl Clone for SnapshotIdentifier
Source§fn clone(&self) -> SnapshotIdentifier
fn clone(&self) -> SnapshotIdentifier
Returns a duplicate of the value. Read more
1.0.0 · 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 SnapshotIdentifier
impl Debug for SnapshotIdentifier
Source§impl Display for SnapshotIdentifier
impl Display for SnapshotIdentifier
Source§impl FromStr for SnapshotIdentifier
impl FromStr for SnapshotIdentifier
Source§impl Hash for SnapshotIdentifier
impl Hash for SnapshotIdentifier
Source§impl PartialEq for SnapshotIdentifier
impl PartialEq for SnapshotIdentifier
impl Eq for SnapshotIdentifier
impl StructuralPartialEq for SnapshotIdentifier
Auto Trait Implementations§
impl Freeze for SnapshotIdentifier
impl RefUnwindSafe for SnapshotIdentifier
impl Send for SnapshotIdentifier
impl Sync for SnapshotIdentifier
impl Unpin for SnapshotIdentifier
impl UnsafeUnpin for SnapshotIdentifier
impl UnwindSafe for SnapshotIdentifier
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