Debian Codegraph @

third_party/rust/rkv/src/backend/impl_lmdb/info.rs

raw
1 // Copyright 2018-2019 Mozilla
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 // this file except in compliance with the License. You may obtain a copy of the
5 // License at http://www.apache.org/licenses/LICENSE-2.0
6 // Unless required by applicable law or agreed to in writing, software distributed
7 // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
8 // CONDITIONS OF ANY KIND, either express or implied. See the License for the
9 // specific language governing permissions and limitations under the License.
10
11 use crate::backend::traits::BackendInfo;
12
13 pub struct InfoImpl(pub(crate) lmdb::Info);
14
15 impl BackendInfo for InfoImpl {
16 fn map_size(&self) -> usize {
17 self.0.map_size()
18 }
19
20 fn last_pgno(&self) -> usize {
21 self.0.last_pgno()
22 }
23
24 fn last_txnid(&self) -> usize {
25 self.0.last_txnid()
26 }
27
28 fn max_readers(&self) -> usize {
29 self.0.max_readers() as usize
30 }
31
32 fn num_readers(&self) -> usize {
33 self.0.num_readers() as usize
34 }
35 }