Patrick Walton dc1184ebe2 Revamp and modernize the Core Foundation APIs.
This change redoes the way Core Foundation works to make the API
smaller, safer, and easier to use. In particular:

* Deriving custom types is now based on `struct`s, not on making a
  type alias of `CFWrapper`.

* The attempts at type safety for `CFArray` and `CFDictionary` were
  removed as not pulling their weight (IMHO).

* Methods that are really unsafe (in particular `wrap_owned` and
  `wrap_shared`) are now marked `unsafe`.

* `wrap_owned` has been renamed to `wrap_under_create_rule` and
  `wrap_shared` has been renamed to `wrap_under_get_rule`, to match
  Apple's documentation.

* `borrow_ref` and friends have been simplified into
  `as_concrete_TypeRef()` and `as_TypeRef()`.

* Dictionaries, arrays, and sets now assume that their elements are
  Core Foundation objects. The old code tried not to assume that,
  but ended up assuming that anyway in a couple of places.

* `CFString`s can be converted from Rust types with the `FromStr`
  trait. `CFNumber`s can be converted to and from Rust types with
  `ToPrimitive` and `FromPrimitive`, eliminating the duplication of
  functionality inside this module.
2013-11-15 09:46:49 +09:00
2013-04-04 19:01:35 -07:00
2013-11-04 14:45:49 -08:00
2013-04-03 18:18:52 -07:00
2013-04-03 18:18:52 -07:00
S
Description
No description provided
2.5 MiB
Languages
Rust 100%