mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 15:18:17 +00:00
refactor(core): move {Decode/Encode}Error
& document the public API. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
c49f190d29
commit
23bc008d65
155 changed files with 1283 additions and 651 deletions
|
@ -1,17 +1,17 @@
|
|||
use std::rc::Rc;
|
||||
|
||||
use ironrdp_core::{ReadCursor, WriteBuf};
|
||||
use ironrdp_core::{DecodeErrorKind, ReadCursor, WriteBuf};
|
||||
use ironrdp_graphics::image_processing::PixelFormat;
|
||||
use ironrdp_graphics::pointer::{DecodedPointer, PointerBitmapTarget};
|
||||
use ironrdp_graphics::rdp6::BitmapStreamDecoder;
|
||||
use ironrdp_graphics::rle::RlePixelFormat;
|
||||
use ironrdp_pdu::codecs::rfx::FrameAcknowledgePdu;
|
||||
use ironrdp_pdu::decode_cursor;
|
||||
use ironrdp_pdu::fast_path::{FastPathHeader, FastPathUpdate, FastPathUpdatePdu, Fragmentation};
|
||||
use ironrdp_pdu::geometry::{InclusiveRectangle, Rectangle as _};
|
||||
use ironrdp_pdu::pointer::PointerUpdateData;
|
||||
use ironrdp_pdu::rdp::headers::ShareDataPdu;
|
||||
use ironrdp_pdu::surface_commands::{FrameAction, FrameMarkerPdu, SurfaceCommand};
|
||||
use ironrdp_pdu::{decode_cursor, DecodeErrorKind};
|
||||
|
||||
use crate::image::DecodedImage;
|
||||
use crate::pointer::PointerCache;
|
||||
|
|
|
@ -26,8 +26,8 @@ pub type SessionResult<T> = Result<T, SessionError>;
|
|||
#[derive(Debug)]
|
||||
pub enum SessionErrorKind {
|
||||
Pdu(ironrdp_pdu::PduError),
|
||||
Encode(ironrdp_pdu::EncodeError),
|
||||
Decode(ironrdp_pdu::DecodeError),
|
||||
Encode(ironrdp_core::EncodeError),
|
||||
Decode(ironrdp_core::DecodeError),
|
||||
Reason(String),
|
||||
General,
|
||||
Custom,
|
||||
|
@ -63,8 +63,8 @@ pub type SessionError = ironrdp_error::Error<SessionErrorKind>;
|
|||
|
||||
pub trait SessionErrorExt {
|
||||
fn pdu(error: ironrdp_pdu::PduError) -> Self;
|
||||
fn encode(error: ironrdp_pdu::EncodeError) -> Self;
|
||||
fn decode(error: ironrdp_pdu::DecodeError) -> Self;
|
||||
fn encode(error: ironrdp_core::EncodeError) -> Self;
|
||||
fn decode(error: ironrdp_core::DecodeError) -> Self;
|
||||
fn general(context: &'static str) -> Self;
|
||||
fn reason(context: &'static str, reason: impl Into<String>) -> Self;
|
||||
fn custom<E>(context: &'static str, e: E) -> Self
|
||||
|
@ -77,11 +77,11 @@ impl SessionErrorExt for SessionError {
|
|||
Self::new("payload error", SessionErrorKind::Pdu(error))
|
||||
}
|
||||
|
||||
fn encode(error: ironrdp_pdu::EncodeError) -> Self {
|
||||
fn encode(error: ironrdp_core::EncodeError) -> Self {
|
||||
Self::new("encode error", SessionErrorKind::Encode(error))
|
||||
}
|
||||
|
||||
fn decode(error: ironrdp_pdu::DecodeError) -> Self {
|
||||
fn decode(error: ironrdp_core::DecodeError) -> Self {
|
||||
Self::new("decode error", SessionErrorKind::Decode(error))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue