pub struct ReplicationState {
pub sequence_number: u64,
pub timestamp: String,
pub base_url: String,
}Expand description
Tracks replication state: current sequence number and base URL.
Fields§
§sequence_number: u64§timestamp: String§base_url: StringImplementations§
Source§impl ReplicationState
impl ReplicationState
Sourcepub fn load(state_dir: &Path) -> OsmicResult<Self>
pub fn load(state_dir: &Path) -> OsmicResult<Self>
Load replication state from a state directory.
Sourcepub fn save(&self, state_dir: &Path) -> OsmicResult<()>
pub fn save(&self, state_dir: &Path) -> OsmicResult<()>
Save replication state to a state directory.
Sourcepub fn next_osc_url(&self) -> String
pub fn next_osc_url(&self) -> String
Compute the URL for the next .osc.gz replication file.
OSM replication files use a 9-digit sequence number split into 3-digit directory segments: 000/001/234.osc.gz
Trait Implementations§
Source§impl Clone for ReplicationState
impl Clone for ReplicationState
Source§fn clone(&self) -> ReplicationState
fn clone(&self) -> ReplicationState
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 ReplicationState
impl Debug for ReplicationState
Source§impl<'de> Deserialize<'de> for ReplicationState
impl<'de> Deserialize<'de> for ReplicationState
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 ReplicationState
impl RefUnwindSafe for ReplicationState
impl Send for ReplicationState
impl Sync for ReplicationState
impl Unpin for ReplicationState
impl UnsafeUnpin for ReplicationState
impl UnwindSafe for ReplicationState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Creates a shared type from an unshared type.