pub fn from_string<S: AsRef<str>>(data: S) -> Value {
		// TODO: This should be done differently
		let string = CString::new(data.as_ref()).unwrap();

		unsafe {
			let mut id = raw_types::strings::StringId(0);

			assert_eq!(
				raw_types::funcs::get_string_id(&mut id, string.as_ptr(), 1, 0, 1),
				1
			);

			Value::new(
				raw_types::values::ValueTag::String,
				raw_types::values::ValueData { string: id },
			)
		}
	}
/// Creates a Value that references a byond string.
/// Will panic if the given string contains null bytes
///
/// # Examples:
/// ```ignore
/// let my_string = Value::from_string("Testing!");
/// ```
Creates a Value that references a byond string.
Will panic if the given string contains null bytes
Creates a Value that references a byond string . Will panic if the given string contains null bytes
pub fn from_string<S: AsRef<str>>(data: S) -> Value {
		// TODO: This should be done differently
		let string = CString::new(data.as_ref()).unwrap();
		unsafe {
			let mut id = raw_types::strings::StringId(0);
			assert_eq!(
				raw_types::funcs::get_string_id(&mut id, string.as_ptr(), 1, 0, 1),
				1
			);
			Value::new(
				raw_types::values::ValueTag::String,
				raw_types::values::ValueData { string: id },
			)
		}
	}
pub fn from_string < S : AsRef < str > > ( data : S ) -> Value { // TODO: This should be done differently let string = CString :: new ( data . as_ref ( ) ) . unwrap ( ) ; unsafe { let mut id = raw_types :: strings :: StringId ( 0 ) ; assert_eq ! ( raw_types funcs get_string_id ( mut id string as_ptr ( ) 1 0 1 ) 1 ) ; Value :: new ( raw_types :: values :: ValueTag :: String , raw_types :: values :: ValueData { string : id } , ) } }
Creates a Value that references a byond string.
Creates a Value that references a byond string .
data
S
examples:
```ignore
let my_string = Value::from_string("Testing!");
```
` ` ` ignore let my_string = Value :: from_string ( " Testing! " ) ; ` ` `