[][src]Module no_proto::pointer::string

NoProto supports Rust's native UTF8 String type.

use no_proto::error::NP_Error;
use no_proto::NP_Factory;

let factory: NP_Factory = NP_Factory::new(r#"{
   "type": "string"
}"#)?;

let mut new_buffer = factory.empty_buffer(None, None);
new_buffer.set(&[], "I want to play a game")?;

assert_eq!("I want to play a game", new_buffer.get::<&str>(&[])?.unwrap());

Type Definitions

NP_String

&str type alias