#[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
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.