Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Commit f799f2c

Browse files
author
Кирилл Безуглый
committed
feat: add SyncIndex::get method
1 parent f5be1aa commit f799f2c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- `tlua::LuaRead` trait implementations for `OsString`, `PathBuf`
99
- tlua::LuaTable::metatable which is a better alternative to the existing `tlua::LuaTable::get_or_create_metatable`
1010
- `ffi::tarantool::box_schema_version` and `ffi::tarantool::box_session_id` functions
11+
- `network::protocol::SyncIndex::get` method
1112

1213
### Changed
1314

tarantool/src/network/protocol/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,18 @@ pub enum ProtocolError {
4343
pub struct SyncIndex(pub(crate) u64);
4444

4545
impl SyncIndex {
46+
/// Increments current sync value.
4647
pub fn next_index(&mut self) -> Self {
4748
let sync = self.0;
4849
self.0 += 1;
4950
Self(sync)
5051
}
52+
53+
/// Returns current sync value.
54+
#[inline(always)]
55+
pub fn get(&self) -> u64 {
56+
self.0
57+
}
5158
}
5259

5360
#[deprecated = "use `TarantoolError` instead"]

0 commit comments

Comments
 (0)