pub struct SequenceState {
pub start: i64,
pub increment: i64,
pub current: i64,
pub called: bool,
pub log_count: i64,
pub data_type: SequenceDataType,
pub min_value: i64,
pub max_value: i64,
pub cycle: bool,
pub cache_size: i64,
pub definition_generation: [u8; 16],
pub owner: Option<SequenceOwner>,
}Expand description
Mutable state of a single SQL sequence.
Fields§
§start: i64§increment: i64§current: i64§called: boolWhether current has already been returned by nextval. Keeping this
bit avoids the lossy start - increment sentinel at BIGINT boundaries.
log_count: i64§data_type: SequenceDataType§min_value: i64§max_value: i64§cycle: bool§cache_size: i64§definition_generation: [u8; 16]§owner: Option<SequenceOwner>Implementations§
Source§impl SequenceState
impl SequenceState
pub fn definition(&self) -> SequenceDefinition
pub fn from_definition(definition: SequenceDefinition) -> SequenceState
pub fn initial( start: i64, increment: i64, data_type: SequenceDataType, ) -> SequenceState
Source§impl SequenceState
impl SequenceState
Sourcepub const fn position_key(&self, object_id: [u8; 16]) -> SequencePositionKey
pub const fn position_key(&self, object_id: [u8; 16]) -> SequencePositionKey
The key of this allocation generation’s position.
Sourcepub fn with_record(
self,
record: Option<&SequenceValuePosition>,
) -> SequenceState
pub fn with_record( self, record: Option<&SequenceValuePosition>, ) -> SequenceState
The state with the value state of the durable record its generation’s latest commit holds, when there is one.
Sourcepub fn at_position(
self,
recorded: Option<RecordedSequencePosition>,
) -> SequenceState
pub fn at_position( self, recorded: Option<RecordedSequencePosition>, ) -> SequenceState
The state at the exact position recorded for it. The value state held here is the durable record’s, which runs ahead of the values handed out while a position is recorded.
Trait Implementations§
Source§impl Clone for SequenceState
impl Clone for SequenceState
Source§fn clone(&self) -> SequenceState
fn clone(&self) -> SequenceState
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 moreimpl Copy for SequenceState
Source§impl Debug for SequenceState
impl Debug for SequenceState
Source§impl<'de> Deserialize<'de> for SequenceState
impl<'de> Deserialize<'de> for SequenceState
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SequenceState, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SequenceState, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SequenceState
Source§impl PartialEq for SequenceState
impl PartialEq for SequenceState
Source§impl Serialize for SequenceState
impl Serialize for SequenceState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SequenceState
Auto Trait Implementations§
impl Freeze for SequenceState
impl RefUnwindSafe for SequenceState
impl Send for SequenceState
impl Sync for SequenceState
impl Unpin for SequenceState
impl UnsafeUnpin for SequenceState
impl UnwindSafe for SequenceState
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more