[][src]Struct uefi::data_types::CStr8

#[repr(transparent)]
pub struct CStr8(_);

A Latin-1 null-terminated string

This type is largely inspired by std::ffi::CStr, see the documentation of CStr for more details on its semantics.

Methods

impl CStr8[src]

pub unsafe fn from_ptr<'ptr>(ptr: *const Char8) -> &'ptr Self[src]

Wraps a raw UEFI string with a safe C string wrapper

pub fn from_bytes_with_nul(chars: &[u8]) -> Result<&Self, FromSliceWithNulError>[src]

Creates a C string wrapper from bytes

pub unsafe fn from_bytes_with_nul_unchecked(chars: &[u8]) -> &Self[src]

Unsafely creates a C string wrapper from bytes

pub fn as_ptr(&self) -> *const Char8[src]

Returns the inner pointer to this C string

pub fn to_bytes(&self) -> &[u8][src]

Converts this C string to a slice of bytes

pub fn to_bytes_with_nul(&self) -> &[u8][src]

Converts this C string to a slice of bytes containing the trailing 0 char

Auto Trait Implementations

impl Unpin for CStr8

impl Send for CStr8

impl Sync for CStr8

Blanket Implementations

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]