Enum capnp::ErrorKind

source ·
#[non_exhaustive]
pub enum ErrorKind {
Show 69 variants Failed, Overloaded, Disconnected, Unimplemented, BufferNotLargeEnough, CannotCreateACanonicalMessageWithACapability, CannotSetAnyPointerFieldToAPrimitiveValue, CantHandleNonStructInlineComposite, EmptyBuffer, EmptySlice, EnumValueOrUnionDiscriminantNotPresent(NotInSchema), ExistingListPointerIsNotByteSized, ExistingListValueIsIncompatibleWithExpectedType, ExistingPointerIsNotAList, ExpectedAListOrBlob, ExpectedAPointerListButGotAListOfDataOnlyStructs, ExpectedAPrimitiveListButGotAListOfPointerOnlyStructs, FailedToFillTheWholeBuffer, FieldAndDefaultMismatch, FieldNotFound, FoundBitListWhereStructListWasExpected, FoundStructListWhereBitListWasExpected, FourByteLengthTooBigForUSize, FourByteSegmentLengthTooBigForUSize, GroupFieldButTypeIsNotStruct, InitIsOnlyValidForStructAndAnyPointerFields, InitnIsOnlyValidForListTextOrDataFields, InlineCompositeListWithNonStructElementsNotSupported, InlineCompositeListsElementsOverrunItsWordCount, InlineCompositeListsOfNonStructTypeAreNotSupported, InvalidNumberOfSegments(usize), InvalidSegmentId(u32), ListAnyPointerNotSupported, ListCapabilityNotSupported, MalformedDoubleFarPointer, MessageContainsInvalidCapabilityPointer, MessageContainsListPointerOfNonBytesWhereDataWasExpected, MessageContainsListPointerOfNonBytesWhereTextWasExpected, MessageContainsListWithIncompatibleElementType, MessageContainsNonCapabilityPointerWhereCapabilityPointerWasExpected, MessageContainsNonStructPointerWhereStructPointerWasExpected, MessageContainsNonListPointerWhereDataWasExpected, MessageContainsNonListPointerWhereListPointerWasExpected, MessageContainsNonListPointerWhereTextWasExpected, MessageContainsNullCapabilityPointer, MessageContainsOutOfBoundsPointer, MessageContainsTextThatIsNotNULTerminated, MessageEndsPrematurely(usize, usize), MessageIsTooDeeplyNested, MessageIsTooDeeplyNestedOrContainsCycles, MessageNotAlignedBy8BytesBoundary, MessageSizeOverflow, MessageTooLarge(usize), NestingLimitExceeded, NotAStruct, OnlyOneOfTheSectionPointersIsPointingToOurself, PackedInputDidNotEndCleanlyOnASegmentBoundary, PrematureEndOfFile, PrematureEndOfPackedInput, ReadLimitExceeded, SettingDynamicCapabilitiesIsUnsupported, StructReaderHadBitwidthOtherThan1, TextBlobMissingNULTerminator, TextContainsNonUtf8Data(Utf8Error), TriedToReadFromNullArena, TypeMismatch, UnalignedSegment, UnexepectedFarPointer, UnknownPointerType,
}
Expand description

The general nature of an error. The purpose of this enum is not to describe the error itself, but rather to describe how the client might want to respond to the error.

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.
§

Failed

Something went wrong

§

Overloaded

The call failed because of a temporary lack of resources. This could be space resources (out of memory, out of disk space) or time resources (request queue overflow, operation timed out).

The operation might work if tried again, but it should NOT be repeated immediately as this may simply exacerbate the problem.

§

Disconnected

The call required communication over a connection that has been lost. The callee will need to re-establish connections and try again.

§

Unimplemented

The requested method is not implemented. The caller may wish to revert to a fallback approach based on other methods.

§

BufferNotLargeEnough

Buffer is not large enough

§

CannotCreateACanonicalMessageWithACapability

Cannot create a canonical message with a capability

§

CannotSetAnyPointerFieldToAPrimitiveValue

Cannot set AnyPointer field to a primitive value

§

CantHandleNonStructInlineComposite

Don’t know how to handle non-STRUCT inline composite.

§

EmptyBuffer

Empty buffer

§

EmptySlice

Empty slice

§

EnumValueOrUnionDiscriminantNotPresent(NotInSchema)

Enum value or union discriminant {} was not present in schema

§

ExistingListPointerIsNotByteSized

Called get_writable_{data|text}_pointer() but existing list pointer is not byte-sized.

§

ExistingListValueIsIncompatibleWithExpectedType

Existing list value is incompatible with expected type.

§

ExistingPointerIsNotAList

Called get_writable_{data|text|list|struct_list}_pointer() but existing pointer is not a list.

§

ExpectedAListOrBlob

Expected a list or blob.

§

ExpectedAPointerListButGotAListOfDataOnlyStructs

Expected a pointer list, but got a list of data-only structs

§

ExpectedAPrimitiveListButGotAListOfPointerOnlyStructs

Expected a primitive list, but got a list of pointer-only structs

§

FailedToFillTheWholeBuffer

failed to fill the whole buffer

§

FieldAndDefaultMismatch

field and default mismatch

§

FieldNotFound

field not found

§

FoundBitListWhereStructListWasExpected

Found bit list where struct list was expected; upgrading boolean lists to struct lists is no longer supported

§

FoundStructListWhereBitListWasExpected

Found struct list where bit list was expected.

§

FourByteLengthTooBigForUSize

Cannot represent 4 byte length as usize. This may indicate that you are running on 8 or 16 bit platform or message is too large.

§

FourByteSegmentLengthTooBigForUSize

Cannot represent 4 byte segment length as usize. This may indicate that you are running on 8 or 16 bit platform or segment is too large

§

GroupFieldButTypeIsNotStruct

group field but type is not Struct

§

InitIsOnlyValidForStructAndAnyPointerFields

init() is only valid for struct and AnyPointer fields

§

InitnIsOnlyValidForListTextOrDataFields

initn() is only valid for list, text, or data fields

§

InlineCompositeListWithNonStructElementsNotSupported

InlineComposite list with non-STRUCT elements not supported.

§

InlineCompositeListsElementsOverrunItsWordCount

InlineComposite list’s elements overrun its word count.

§

InlineCompositeListsOfNonStructTypeAreNotSupported

InlineComposite lists of non-STRUCT type are not supported.

§

InvalidNumberOfSegments(usize)

Too many or too few segments {segment_count}

§

InvalidSegmentId(u32)

Invalid segment id {id}

§

ListAnyPointerNotSupported

List(AnyPointer) not supported.

§

ListCapabilityNotSupported

List(Capability) not supported

§

MalformedDoubleFarPointer

Malformed double-far pointer.

§

MessageContainsInvalidCapabilityPointer

Message contains invalid capability pointer.

§

MessageContainsListPointerOfNonBytesWhereDataWasExpected

Message contains list pointer of non-bytes where data was expected.

§

MessageContainsListPointerOfNonBytesWhereTextWasExpected

Message contains list pointer of non-bytes where text was expected.

§

MessageContainsListWithIncompatibleElementType

Message contains list with incompatible element type.

§

MessageContainsNonCapabilityPointerWhereCapabilityPointerWasExpected

Message contains non-capability pointer where capability pointer was expected.

§

MessageContainsNonStructPointerWhereStructPointerWasExpected

Message contains non-struct pointer where struct pointer was expected.

§

MessageContainsNonListPointerWhereDataWasExpected

Message contains non-list pointer where data was expected.

§

MessageContainsNonListPointerWhereListPointerWasExpected

Message contains non-list pointer where list pointer was expected

§

MessageContainsNonListPointerWhereTextWasExpected

Message contains non-list pointer where text was expected.

§

MessageContainsNullCapabilityPointer

Message contains null capability pointer.

§

MessageContainsOutOfBoundsPointer

Message contains out-of-bounds pointer,

§

MessageContainsTextThatIsNotNULTerminated

Message contains text that is not NUL-terminated

§

MessageEndsPrematurely(usize, usize)

Message ends prematurely. Header claimed {header} words, but message only has {body} words,

§

MessageIsTooDeeplyNested

Message is too deeply nested.

§

MessageIsTooDeeplyNestedOrContainsCycles

Message is too deeply-nested or contains cycles.

§

MessageNotAlignedBy8BytesBoundary

Message was not aligned by 8 bytes boundary. Either ensure that message is properly aligned or compile capnp crate with "unaligned" feature enabled.

§

MessageSizeOverflow

Message’s size cannot be represented in usize

§

MessageTooLarge(usize)

Message is too large

§

NestingLimitExceeded

Nesting limit exceeded

§

NotAStruct

Not a struct

§

OnlyOneOfTheSectionPointersIsPointingToOurself

Only one of the section pointers is pointing to ourself

§

PackedInputDidNotEndCleanlyOnASegmentBoundary

Packed input did not end cleanly on a segment boundary.

§

PrematureEndOfFile

Premature end of file

§

PrematureEndOfPackedInput

Premature end of packed input.

§

ReadLimitExceeded

Read limit exceeded

§

SettingDynamicCapabilitiesIsUnsupported

setting dynamic capabilities is unsupported

§

StructReaderHadBitwidthOtherThan1

Struct reader had bitwidth other than 1

§

TextBlobMissingNULTerminator

Text blob missing NUL terminator.

§

TextContainsNonUtf8Data(Utf8Error)

Text contains non-utf8 data

§

TriedToReadFromNullArena

Tried to read from null arena

§

TypeMismatch

type mismatch

§

UnalignedSegment

Detected unaligned segment. You must either ensure all of your segments are 8-byte aligned, or you must enable the “unaligned” feature in the capnp crate

§

UnexepectedFarPointer

Unexpected far pointer

§

UnknownPointerType

Unknown pointer type.

Trait Implementations§

source§

impl Clone for ErrorKind

source§

fn clone(&self) -> ErrorKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ErrorKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ErrorKind

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq for ErrorKind

source§

fn eq(&self, other: &ErrorKind) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for ErrorKind

source§

impl Eq for ErrorKind

source§

impl StructuralPartialEq for ErrorKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.