#[non_exhaustive]pub enum EncodeError {
Capacity {
needed: usize,
available: usize,
},
}Expand description
An encode that failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Capacity
The output buffer is shorter than the encoding.
Fields
§
needed: usizeThe bytes the encoding needs: a lower bound, not always the whole requirement.
An encoder that knows its size before it writes reports the whole
encoding. One that builds incrementally — the FlatBuffers encoder
does, because a child’s size is known only once it is written —
reports what it needed at the point it gave up, which is at least
available + 1 and at most the whole encoding. Either way a
caller that grows the buffer to needed has made progress, and
one that wants a buffer that always suffices uses
Payload::MAX_SIZE.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone for EncodeError
impl Copy for EncodeError
Source§impl Debug for EncodeError
impl Debug for EncodeError
impl Eq for EncodeError
Source§impl PartialEq for EncodeError
impl PartialEq for EncodeError
impl StructuralPartialEq for EncodeError
Auto Trait Implementations§
impl Freeze for EncodeError
impl RefUnwindSafe for EncodeError
impl Send for EncodeError
impl Sync for EncodeError
impl Unpin for EncodeError
impl UnsafeUnpin for EncodeError
impl UnwindSafe for EncodeError
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