docs

You are reading the docs for v0.1.2. Nabi 0.1.2 is no longer supported. Latest release: v0.1.3 →

bare::ffi::objc::string

On this page

NSString and str. Both copy: an NSString holds UTF-16, a str UTF-8.

Structs

NSStringSource

pub struct NSString

NSString, Foundation's string class: a program using it links Foundation (#[link(name = "Foundation", kind = "framework")]).

  • pub fn from_str(s: str) -> Id<NSString>§

    Source

    An NSString holding a copy of s.

Trait implementations 1

Functions

nsSource

pub fn ns(s: str) -> Id<NSString>

NSString::from_str(s), short: ns("text").

Implementations

impl Id

  • pub fn to_str(self) -> str§

    Source

    The text as a str, copied. An unpaired UTF-16 surrogate, which UTF-8 cannot hold, becomes U+FFFD.