@@ -37,7 +37,7 @@ use web_sys::HtmlCanvasElement;
3737
3838use crate :: canvas:: Canvas ;
3939use crate :: clipboard:: { ClipboardTransaction , WasmClipboard , WasmClipboardBackend , WasmClipboardBackendMessage } ;
40- use crate :: error:: { RemoteDesktopError , RemoteDesktopErrorKind } ;
40+ use crate :: error:: { IronError , IronErrorKind } ;
4141use crate :: image:: extract_partial_image;
4242use crate :: input:: InputTransaction ;
4343use crate :: network_client:: WasmNetworkClient ;
@@ -103,7 +103,7 @@ impl Default for SessionBuilderInner {
103103
104104#[ wasm_bindgen]
105105impl SessionBuilder {
106- pub fn construct ( ) -> SessionBuilder {
106+ pub fn init ( ) -> SessionBuilder {
107107 Self ( Rc :: new ( RefCell :: new ( SessionBuilderInner :: default ( ) ) ) )
108108 }
109109
@@ -220,7 +220,7 @@ impl SessionBuilder {
220220 self . clone ( )
221221 }
222222
223- pub async fn connect ( & self ) -> Result < Session , RemoteDesktopError > {
223+ pub async fn connect ( & self ) -> Result < Session , IronError > {
224224 let (
225225 username,
226226 destination,
@@ -295,11 +295,11 @@ impl SessionBuilder {
295295 loop {
296296 match ws. state ( ) {
297297 websocket:: State :: Closing | websocket:: State :: Closed => {
298- return Err ( RemoteDesktopError :: from ( anyhow:: anyhow!(
298+ return Err ( IronError :: from ( anyhow:: anyhow!(
299299 "failed to connect to {proxy_address} (WebSocket is `{:?}`)" ,
300300 ws. state( )
301301 ) )
302- . with_kind ( RemoteDesktopErrorKind :: ProxyConnect ) ) ;
302+ . with_kind ( IronErrorKind :: ProxyConnect ) ) ;
303303 }
304304 websocket:: State :: Connecting => {
305305 trace ! ( "WebSocket is connecting to proxy at {proxy_address}..." ) ;
@@ -417,7 +417,7 @@ pub struct Session {
417417
418418#[ wasm_bindgen]
419419impl Session {
420- pub async fn run ( & self ) -> Result < SessionTerminationInfo , RemoteDesktopError > {
420+ pub async fn run ( & self ) -> Result < SessionTerminationInfo , IronError > {
421421 let rdp_reader = self
422422 . rdp_reader
423423 . borrow_mut ( )
@@ -712,17 +712,17 @@ impl Session {
712712 }
713713 }
714714
715- pub fn apply_inputs ( & self , transaction : InputTransaction ) -> Result < ( ) , RemoteDesktopError > {
715+ pub fn apply_inputs ( & self , transaction : InputTransaction ) -> Result < ( ) , IronError > {
716716 let inputs = self . input_database . borrow_mut ( ) . apply ( transaction) ;
717717 self . h_send_inputs ( inputs)
718718 }
719719
720- pub fn release_all_inputs ( & self ) -> Result < ( ) , RemoteDesktopError > {
720+ pub fn release_all_inputs ( & self ) -> Result < ( ) , IronError > {
721721 let inputs = self . input_database . borrow_mut ( ) . release_all ( ) ;
722722 self . h_send_inputs ( inputs)
723723 }
724724
725- fn h_send_inputs ( & self , inputs : smallvec:: SmallVec < [ FastPathInputEvent ; 2 ] > ) -> Result < ( ) , RemoteDesktopError > {
725+ fn h_send_inputs ( & self , inputs : smallvec:: SmallVec < [ FastPathInputEvent ; 2 ] > ) -> Result < ( ) , IronError > {
726726 if !inputs. is_empty ( ) {
727727 trace ! ( "Inputs: {inputs:?}" ) ;
728728
@@ -740,7 +740,7 @@ impl Session {
740740 num_lock : bool ,
741741 caps_lock : bool ,
742742 kana_lock : bool ,
743- ) -> Result < ( ) , RemoteDesktopError > {
743+ ) -> Result < ( ) , IronError > {
744744 use ironrdp:: pdu:: input:: fast_path:: FastPathInput ;
745745
746746 let event = ironrdp:: input:: synchronize_event ( scroll_lock, num_lock, caps_lock, kana_lock) ;
@@ -755,15 +755,15 @@ impl Session {
755755 Ok ( ( ) )
756756 }
757757
758- pub fn shutdown ( & self ) -> Result < ( ) , RemoteDesktopError > {
758+ pub fn shutdown ( & self ) -> Result < ( ) , IronError > {
759759 self . input_events_tx
760760 . unbounded_send ( RdpInputEvent :: TerminateSession )
761761 . context ( "failed to send terminate session event to writer task" ) ?;
762762
763763 Ok ( ( ) )
764764 }
765765
766- pub async fn on_clipboard_paste ( & self , content : ClipboardTransaction ) -> Result < ( ) , RemoteDesktopError > {
766+ pub async fn on_clipboard_paste ( & self , content : ClipboardTransaction ) -> Result < ( ) , IronError > {
767767 self . input_events_tx
768768 . unbounded_send ( RdpInputEvent :: ClipboardBackend (
769769 WasmClipboardBackendMessage :: LocalClipboardChanged ( content) ,
@@ -773,7 +773,7 @@ impl Session {
773773 Ok ( ( ) )
774774 }
775775
776- fn set_cursor_style ( & self , style : CursorStyle ) -> Result < ( ) , RemoteDesktopError > {
776+ fn set_cursor_style ( & self , style : CursorStyle ) -> Result < ( ) , IronError > {
777777 let ( kind, data, hotspot_x, hotspot_y) = match style {
778778 CursorStyle :: Default => ( "default" , None , None , None ) ,
779779 CursorStyle :: Hidden => ( "hidden" , None , None , None ) ,
@@ -824,7 +824,7 @@ impl Session {
824824 false
825825 }
826826
827- pub fn extension_call ( _value : JsValue ) -> Result < JsValue , RemoteDesktopError > {
827+ pub fn extension_call ( _value : JsValue ) -> Result < JsValue , IronError > {
828828 Ok ( JsValue :: null ( ) )
829829 }
830830}
@@ -922,7 +922,7 @@ async fn connect(
922922 clipboard_backend,
923923 use_display_control,
924924 } : ConnectParams ,
925- ) -> Result < ( connector:: ConnectionResult , WebSocket ) , RemoteDesktopError > {
925+ ) -> Result < ( connector:: ConnectionResult , WebSocket ) , IronError > {
926926 let mut framed = ironrdp_futures:: LocalFuturesFramed :: new ( ws) ;
927927
928928 let mut connector = ClientConnector :: new ( config) ;
@@ -969,7 +969,7 @@ async fn connect_rdcleanpath<S>(
969969 destination : String ,
970970 proxy_auth_token : String ,
971971 pcb : Option < String > ,
972- ) -> Result < ( ironrdp_futures:: Upgraded , Vec < u8 > ) , RemoteDesktopError >
972+ ) -> Result < ( ironrdp_futures:: Upgraded , Vec < u8 > ) , IronError >
973973where
974974 S : ironrdp_futures:: FramedRead + FramedWrite ,
975975{
@@ -1048,10 +1048,10 @@ where
10481048 server_addr,
10491049 } => ( x224_connection_response, server_cert_chain, server_addr) ,
10501050 ironrdp_rdcleanpath:: RDCleanPath :: Err ( error) => {
1051- return Err ( RemoteDesktopError :: from (
1052- anyhow:: Error :: new ( error) . context ( "received an RDCleanPath error" ) ,
1053- )
1054- . with_kind ( RemoteDesktopErrorKind :: RDCleanPath ) ) ;
1051+ return Err (
1052+ IronError :: from ( anyhow:: Error :: new ( error) . context ( "received an RDCleanPath error" ) )
1053+ . with_kind ( IronErrorKind :: RDCleanPath ) ,
1054+ ) ;
10551055 }
10561056 } ;
10571057
0 commit comments