diff --git a/src/datastructures/string.rs b/src/datastructures/string.rs index 4f668fc..530ccb3 100644 --- a/src/datastructures/string.rs +++ b/src/datastructures/string.rs @@ -6,7 +6,7 @@ use crate::{ #[derive(Clone, Copy, FromBytes, FromZeroes, AsBytes, Unaligned)] #[repr(transparent)] -struct Str { +pub struct Str { data: FileRange, } @@ -19,7 +19,7 @@ impl Str { } impl Str { - fn set(self, transaction: &mut TransactionHandle, s: &str) -> Self { + pub fn set(self, transaction: &mut TransactionHandle, s: &str) -> Self { let data = if s.is_empty() { Str::new().data } else { @@ -35,20 +35,20 @@ impl Str { Str { data } } - fn get(self, reader: &impl ReaderTrait) -> &str { + pub fn get(self, reader: &impl ReaderTrait) -> &str { std::str::from_utf8(reader.read_raw(self.data)).unwrap() } } impl FilePointer { - fn set(self, transaction: &mut TransactionHandle, s: &str) -> FilePointer { + pub fn set(self, transaction: &mut TransactionHandle, s: &str) -> FilePointer { let new_str = transaction.read::(self).set(transaction, s); let (ptr, data) = transaction.modify(self); *data = new_str; ptr } - fn get(self, reader: &impl ReaderTrait) -> &str { + pub fn get(self, reader: &impl ReaderTrait) -> &str { reader.read(self).get(reader) } }