Expand description
§IronRDP Core
IronRDP common traits and types.
Macros§
- assert_
impl - Asserts that the type implements all of the given traits.
- assert_
obj_ safe - Asserts that the traits support dynamic dispatch.
- cast_
int - Safely casts an integer to a different integer type.
- cast_
length - Safely casts a length to a different integer type.
- ensure_
fixed_ part_ size - Ensures that a buffer has at least the fixed part size of a struct.
- ensure_
size - Ensures that a buffer has at least the expected size.
- function
- Finds the name of the function in which this macro is expanded
- impl_
as_ any - Implement
AsAny
for the given type. - invalid_
field_ err - Creates an “invalid field” error with context information.
- not_
enough_ bytes_ err - Creates a “not enough bytes” error with context information.
- other_
err - Creates a generic “other” error with optional context and source information.
- read_
padding - Moves read cursor, ignoring padding bytes.
- unexpected_
message_ type_ err - Creates an “unexpected message type” error with context information.
- unsupported_
value_ err - Creates an “unsupported value” error with context information.
- unsupported_
version_ err - Creates an “unsupported version” error with context information.
- write_
padding - Writes zeroes using as few
write_u*
calls as possible.
Structs§
- NotEnough
Bytes Error - Error indicating that there are not enough bytes in the buffer to perform an operation.
- Read
Cursor - A cursor for reading bytes from a buffer.
- Write
Cursor - A cursor for writing bytes to a buffer.
Enums§
- Decode
Error Kind - Enum representing different kinds of decode errors.
- Encode
Error Kind - Represents the different kinds of errors that can occur during encoding operations.
Traits§
- AsAny
- Type information (
TypeId
) may be retrieved at runtime for this type. - Decode
- Trait for types that can be decoded from a byte stream.
- Decode
Owned - Similar to
Decode
but unconditionally returns an owned type. - Encode
- PDU that can be encoded into its binary form.
- Into
Owned - Used to produce an owned version of a given data.
- Invalid
Field Err - Trait for creating “invalid field” errors.
- NotEnough
Bytes Err - Trait for creating “not enough bytes” errors.
- Other
Err - Trait for creating generic “other” errors.
- Unexpected
Message Type Err - Trait for creating “unexpected message type” errors.
- Unsupported
Value Err - Trait for creating “unsupported value” errors.
- Unsupported
Version Err - Trait for creating “unsupported version” errors.
- With
Source - Trait for adding a source to an error type.
Functions§
- decode
- Decodes a value of type
T
from a byte slice. - decode_
cursor - Decodes a value of type
T
from aReadCursor
. - decode_
owned - Decodes an owned value of type
T
from a byte slice. - decode_
owned_ cursor - Decodes an owned value of type
T
from aReadCursor
. - encode
- Encodes the given PDU in-place into the provided buffer and returns the number of bytes written.
- encode_
cursor - Encodes the given PDU in-place using the provided
WriteCursor
. - invalid_
field_ err - Helper function to create an “invalid field” error.
- invalid_
field_ err_ with_ source - Helper function to create an “invalid field” error with a source.
- name
- Gets the name of this PDU.
- not_
enough_ bytes_ err - Helper function to create a “not enough bytes” error.
- other_
err - Helper function to create a generic “other” error.
- other_
err_ with_ source - Helper function to create a generic “other” error with a source.
- read_
padding - Moves read cursor, ignoring padding bytes.
- size
- Computes the size in bytes for this PDU.
- unexpected_
message_ type_ err - Helper function to create an “unexpected message type” error.
- unsupported_
value_ err - Helper function to create an “unsupported value” error.
- unsupported_
version_ err - Helper function to create an “unsupported version” error.
- write_
padding - Writes zeroes using as few
write_u*
calls as possible.
Type Aliases§
- Decode
Error - An error type specifically for encoding operations, wrapping an
DecodeErrorKind
. - Decode
Result - A result type for decoding operations, which can either succeed with a value of type
T
or fail with anDecodeError
. - Encode
Error - An error type specifically for encoding operations, wrapping an
EncodeErrorKind
. - Encode
Result - A result type for encoding operations, which can either succeed with a value of type
T
or fail with anEncodeError
.