Crate ironrdp_core

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

NotEnoughBytesError
Error indicating that there are not enough bytes in the buffer to perform an operation.
ReadCursor
A cursor for reading bytes from a buffer.
WriteCursor
A cursor for writing bytes to a buffer.

Enums§

DecodeErrorKind
Enum representing different kinds of decode errors.
EncodeErrorKind
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.
DecodeOwned
Similar to Decode but unconditionally returns an owned type.
Encode
PDU that can be encoded into its binary form.
IntoOwned
Used to produce an owned version of a given data.
InvalidFieldErr
Trait for creating “invalid field” errors.
NotEnoughBytesErr
Trait for creating “not enough bytes” errors.
OtherErr
Trait for creating generic “other” errors.
UnexpectedMessageTypeErr
Trait for creating “unexpected message type” errors.
UnsupportedValueErr
Trait for creating “unsupported value” errors.
UnsupportedVersionErr
Trait for creating “unsupported version” errors.
WithSource
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 a ReadCursor.
decode_owned
Decodes an owned value of type T from a byte slice.
decode_owned_cursor
Decodes an owned value of type T from a ReadCursor.
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§

DecodeError
An error type specifically for encoding operations, wrapping an DecodeErrorKind.
DecodeResult
A result type for decoding operations, which can either succeed with a value of type T or fail with an DecodeError.
EncodeError
An error type specifically for encoding operations, wrapping an EncodeErrorKind.
EncodeResult
A result type for encoding operations, which can either succeed with a value of type T or fail with an EncodeError.