Skip to content

Commit

Permalink
Some docs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 31, 2023
1 parent e8b5755 commit fef7c3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cidre/src/ns/coder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ use crate::{arc, define_obj_type, ns, objc};
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[repr(isize)]
pub enum DecodingFailurePolicy {
/// On decode failure, the ns::Coder will raise an exception internally
/// On decode failure, the [`ns::Coder`] will raise an exception internally
/// to propagate failure messages (and unwind the stack). This exception can be transformed
/// into an ns::Error via any of the TopLevel decode APIs.
RaiseException,

/// On decode failure, the NSCoder will capture the failure as an ns::Error,
/// On decode failure, the [`ns::Coder`] will capture the failure as an [`ns::Error`],
/// and prevent further decodes (by returning 0 / None equivalent as appropriate).
/// Clients should consider using this policy if they know that all encoded objects behave correctly
/// in the presence of decode failures (e.g. they use fail_with_error to communicate decode failures
/// and don't raise exceptions for error propagation)
SetErrorAndReturn,
}

define_obj_type!(pub Coder(ns::Id), NS_CODER);
define_obj_type!(
#[doc(alias = "NSCoder")]
pub Coder(ns::Id), NS_CODER
);

impl Coder {}

#[link(name = "ns", kind = "static")]
Expand Down
2 changes: 2 additions & 0 deletions cidre/src/ns/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ define_obj_type!(
pub NotificationCenter(ns::Id), NS_NOTIFICATION_CENTER
);

unsafe impl Send for NotificationCenter {}

impl NotificationCenter {
#[objc::cls_msg_send(defaultCenter)]
pub fn default() -> &'static mut Self;
Expand Down

0 comments on commit fef7c3b

Please sign in to comment.