[go: up one dir, main page]

objc2-core-foundation 0.3.0

Bindings to the CoreFoundation framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![cfg(all(feature = "CFBase", feature = "CFString"))]
use core::fmt;

use crate::{CFError, CFErrorCopyDescription};

impl fmt::Display for CFError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let desc = unsafe { CFErrorCopyDescription(self) }.unwrap();
        write!(f, "{desc}")
    }
}

#[cfg(feature = "std")] // use core::error::Error from Rust 1.81 once in MSRV.
impl std::error::Error for CFError {}