pub enum Error {
Invalid,
Unspecified,
ProtocolDeviation,
NotFound,
HandleAccessDenied,
NoMemory,
ConstraintsIntersectionEmpty,
Pending,
TooManyGroupChildCombinations,
// some variants omitted
}
Expand description
Regardless of which error code, any client retries should be very limited in number, if any.
A Error value should never be stored in a zx_status_t, since positive values in zx_status_t are deprecated.
Variants§
Invalid
This is not a valid error value in this error enum. The server will never send this value as a failure code. This value is not treated as “success”. In some languages, a locally default-initialized Error instance will have this value until it is initialized with a valid positive error code.
Unspecified
Unspecified error.
This error code is used when no other error code applies, and the error is probably not due to problematic messages sent to the server via the channel delivering this error.
This error should be handled by the client as a generic error.
As one example, this error is used when a different client channel has
closed from the client end unexpectedly (without sending
[fuchsia.sysmem2/Node.Release
] first), thereby causing failure of any
nodes in the same tree or sub-tree. In this usage, the main thing that’s
relevant is it isn’t the receiving client’s “fault” - no reason to be
more specific since there’s probably nothing the receiving client could
do about the error, at least not directly.
As another example, this error can be used if a syscall that is normally expected to succeed fails unexpectedly, and there’s no identified reason to “blame” the client.
A client should never require / depend on a particular cause of error continuing to result in UNSPECIFIED, as any particular error cause can potentially start resulting in a more specific error code in future.
ProtocolDeviation
A required field wasn’t set or a specified value was invalid. See the log for more info.
This is also used when a message is received from the client in the wrong order or in some way inconsistent with protocol rules.
NotFound
A client-specified object or ID was not found.
HandleAccessDenied
The object handle doesn’t have sufficient rights to perform the request.
NoMemory
The allocation could not be satisfied due to lack of available memory.
The memory exhaustion can be specific to the heap that was selected during constraints aggregation, so in some cases, this error can happen despite normal system RAM not being near exhaustion, depending on configured and selected heap(s).
ConstraintsIntersectionEmpty
The request is valid but cannot be satisfied, perhaps due to hardware
limitations. This happens if participants involved in this allocation
have incompatible constraints (empty intersection, roughly speaking).
See the log for more info. In cases where a participant could
potentially be treated as optional, see [BufferCollectionTokenGroup
].
This can also happen if there aren’t enough buffers in a pre-existing
collection to satisfy an additional token (including sub-tree of derived
tokens) created with [fuchsia.sysmem2/BufferCollection.AttachToken
].
This can also happen if a client’s node is under a group and a different group child is selected instead.
Pending
Allocation hasn’t been attempted yet. Calling
[fuchsia.sysmem2/BufferCollection.WaitForAllBuffersAllocated
] would
(likely) block.
TooManyGroupChildCombinations
Too many BufferCollectionTokenGroup
child token selection combinations
exist and were considered, causing sysmem to give up on allocating
rather than enumerate the rest.
Implementations§
Source§impl Error
impl Error
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<Error, D> for Error
impl<D: ResourceDialect> Decode<Error, D> for Error
Source§impl Ord for Error
impl Ord for Error
Source§impl PartialOrd for Error
impl PartialOrd for Error
Source§impl TypeMarker for Error
impl TypeMarker for Error
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for Error
impl ValueTypeMarker for Error
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)