pub struct Jeff<'a> { /* private fields */ }
Expand description
Copy-on-write representation of jeff programs.
This thin wrapper over the Cap’n Proto-generated code provides a safe interface to load and store jeff files, converting old versions to the current one as needed.
Implementations§
Source§impl<'a> Jeff<'a>
impl<'a> Jeff<'a>
Sourcepub const VERSION: u32 = 0u32
pub const VERSION: u32 = 0u32
Current version of the jeff format.
Loading a jeff file with a previous version will automatically upgrade it to this version.
Sourcepub fn read_slice(slice: &mut &'a [u8]) -> Result<Self, JeffError>
pub fn read_slice(slice: &mut &'a [u8]) -> Result<Self, JeffError>
Read a jeff program from a slice without copying the data.
The data is not copied, but the buffer must outlive the jeff object. After this call, the slice will be advanced to the end of the jeff data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Jeff<'a>
impl<'a> !RefUnwindSafe for Jeff<'a>
impl<'a> Send for Jeff<'a>
impl<'a> !Sync for Jeff<'a>
impl<'a> Unpin for Jeff<'a>
impl<'a> UnwindSafe for Jeff<'a>
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,
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