We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e55dd89 commit aa011b4Copy full SHA for aa011b4
1 file changed
libsql-wal/src/io/buf.rs
@@ -154,6 +154,17 @@ impl<T> ZeroCopyBoxIoBuf<T> {
154
Self { init: 0, inner }
155
}
156
157
+ /// same as new_uninit, but partially fills the buffer starting at offset
158
+ ///
159
+ /// # Safety: The caller must ensure that the remaining bytes are initialized
160
+ pub unsafe fn new_uninit_partial(inner: Box<T>, offset: usize) -> Self {
161
+ assert!(offset < size_of::<T>());
162
+ Self {
163
+ inner,
164
+ init: offset,
165
+ }
166
167
+
168
fn is_init(&self) -> bool {
169
self.init == size_of::<T>()
170
0 commit comments