Struct nsstring::nsCStringRepr [] [src]

#[repr(C)]
pub struct nsCStringRepr { /* fields omitted */ }

The representation of a ns[C]String type in C++. This type is used internally by our definition of ns[C]String to ensure layout compatibility with the C++ ns[C]String type.

This type may also be used in place of a C++ ns[C]String inside of struct definitions which are shared with C++, as it has identical layout to our ns[C]String type.

This struct will leak its data if dropped from rust. See the module documentation for more information on this type.

Methods from Deref<Target = nsACString>

[src]

Assign the value of other into self, overwriting any value currently stored. Performs an optimized assignment when possible if other is a nsA[C]String.

[src]

Assign the value of other into self, overwriting any value currently stored. Performs an optimized assignment when possible if other is a nsA[C]String.

Returns Ok(()) on success, and Err(()) if the allocation failed.

[src]

Take the value of other and set self, overwriting any value currently stored. The passed-in string will be truncated.

[src]

Take the value of other and set self, overwriting any value currently stored. If this function fails, the source string will be left untouched, otherwise it will be truncated.

Returns Ok(()) on success, and Err(()) if the allocation failed.

[src]

Append the value of other into self.

[src]

Append the value of other into self.

Returns Ok(()) on success, and Err(()) if the allocation failed.

[src]

Set the length of the string to the passed-in length, and expand the backing capacity to match. This method is unsafe as it can expose uninitialized memory when len is greater than the current length of the string.

[src]

Set the length of the string to the passed-in length, and expand the backing capacity to match. This method is unsafe as it can expose uninitialized memory when len is greater than the current length of the string.

Returns Ok(()) on success, and Err(()) if the allocation failed.

[src]

[src]

Get a &mut reference to the backing data for this string. This method will allocate and copy if the current backing buffer is immutable or shared.

[src]

Get a &mut reference to the backing data for this string. This method will allocate and copy if the current backing buffer is immutable or shared.

Returns Ok(&mut [T]) on success, and Err(()) if the allocation failed.

[src]

[src]

[src]

[src]

[src]

Trait Implementations

impl Debug for nsCStringRepr
[src]

[src]

Formats the value using the given formatter. Read more

impl Deref for nsCStringRepr
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl DerefMut for nsCStringRepr
[src]

[src]

Mutably dereferences the value.