diff --git a/cidre/src/mc/browser_view_controller.rs b/cidre/src/mc/browser_view_controller.rs index 9a29983c..24fd529c 100644 --- a/cidre/src/mc/browser_view_controller.rs +++ b/cidre/src/mc/browser_view_controller.rs @@ -45,7 +45,7 @@ impl BrowserViewController { pub fn with_service_type<'ear>( service_type: &ns::String, session: &mc::Session, - ) -> Result, &'ear ns::Exception> { + ) -> ns::ExResult<'ear, arc::R> { ns::try_catch(|| unsafe { Self::alloc().init_with_service_type_throws(service_type, session) }) @@ -54,7 +54,7 @@ impl BrowserViewController { pub fn with_browser<'ear>( browser: &mc::NearbyServiceBrowser, session: &mc::Session, - ) -> Result, &'ear ns::Exception> { + ) -> ns::ExResult<'ear, arc::R> { ns::try_catch(|| unsafe { Self::alloc().init_with_browser_throws(browser, session) }) } diff --git a/cidre/src/mc/session.rs b/cidre/src/mc/session.rs index e5278536..73017142 100644 --- a/cidre/src/mc/session.rs +++ b/cidre/src/mc/session.rs @@ -75,7 +75,7 @@ impl arc::A { pub unsafe fn init_with_encryption_throws( self, peer: &mc::PeerId, - sec_identity: Option>, + sec_identity: Option<&ns::Array>, encryption_preference: mc::EncryptionPreference, ) -> arc::R; } @@ -85,16 +85,16 @@ impl Session { /// Create a session with an MCPeerID for the local peer. #[inline] - pub fn with_peer<'ear>(peer: &mc::PeerId) -> Result, &'ear ns::Exception> { + pub fn with_peer<'ear>(peer: &mc::PeerId) -> ns::ExResult<'ear, arc::R> { ns::try_catch(|| unsafe { Self::alloc().init_with_peer_throws(peer) }) } #[inline] pub fn with_encryption<'ear>( peer: &mc::PeerId, - sec_identity: Option>, + sec_identity: Option<&ns::Array>, encryption_preference: mc::EncryptionPreference, - ) -> Result, &'ear ns::Exception> { + ) -> ns::ExResult<'ear, arc::R> { ns::try_catch(|| unsafe { Self::alloc().init_with_encryption_throws(peer, sec_identity, encryption_preference) }) @@ -155,7 +155,7 @@ impl Session { &mut self, stream_name: &ns::String, to_peer: &mc::PeerId, - ) -> Result, &'ear ns::Error> { + ) -> ns::Result<'ear, arc::R> { ns::if_none(|err| unsafe { self.start_stream_err(stream_name, to_peer, err) }) } @@ -163,13 +163,13 @@ impl Session { pub fn my_peer_id(&self) -> &mc::PeerId; #[objc::msg_send(securityIdentity)] - pub fn security_identity(&self) -> Option<&ns::Array>; + pub fn security_identity(&self) -> Option>>; #[objc::msg_send(encryptionPreference)] pub fn encryption_preference(&self) -> mc::EncryptionPreference; #[objc::msg_send(connectedPeers)] - pub fn connected_peers(&self) -> &ns::Array; + pub fn connected_peers(&self) -> arc::R>; } #[objc::protocol(MCSessionDelegate)] @@ -243,7 +243,7 @@ impl Session { pub fn nearby_data_for_peer_ch_block( &self, peer: &mc::PeerId, - handler: &blocks::ResultCompletionHandler, + handler: &mut blocks::ResultCompletionHandler, ); pub fn nearby_data_for_peer_ch(