/// Constructs an NulStr from a pointer.
///
/// # Safety
///
/// [The same as the type-level safety docs](#safety)
///
/// # Correctness
///
/// If the string contains interior nuls,
/// the first nul will be considered the string terminator.
///
/// # Example
///
/// ```rust
/// use abi_stable::sabi_types::NulStr;
///
/// const FOO: NulStr<'_> = unsafe { NulStr::from_ptr("foo\0".as_ptr()) };
/// assert_eq!(FOO, "foo");
///
/// const BAR: NulStr<'_> = unsafe { NulStr::from_ptr("bar\0".as_ptr()) };
/// assert_eq!(BAR, "bar");
///
/// const HEWWO: NulStr<'_> = unsafe { NulStr::from_ptr("Hello, world!\0".as_ptr()) };
/// assert_eq!(HEWWO, "Hello, world!");
///
/// const TRUNCATED: NulStr<'_> = unsafe { NulStr::from_ptr("baz\0world!\0".as_ptr()) };
/// assert_eq!(TRUNCATED, "baz");
///
/// ```
Constructs an NulStr from a pointer.
Constructs an NulStr from a pointer .
pub const unsafe fn from_ptr(ptr: *const u8) -> Self {
        Self {
            ptr: NonNull::new_unchecked(ptr as *mut u8),
            _marker: PhantomData,
        }
    }
pub const unsafe fn from_ptr ( ptr : * const u8 ) -> Self { Self { ptr : NonNull :: new_unchecked ( ptr as * mut u8 ) , _marker : PhantomData , } }
Constructs an NulStr from a pointer.
Constructs an NulStr from a pointer .
ptr
*const u8
safety
[The same as the type-level safety docs](#safety)
[ The same as the type - level safety docs ] ( #safety )
correctness
If the string contains interior nuls,
the first nul will be considered the string terminator.
If the string contains interior nuls the first nul will be considered the string terminator .
example
```rust
use abi_stable::sabi_types::NulStr.





const HEWWO: NulStr<'_> = unsafe { NulStr::from_ptr("Hello, world!\0".as_ptr()) };
assert_eq!(HEWWO, "Hello, world!").

const TRUNCATED: NulStr<'_> = unsafe { NulStr::from_ptr("baz\0world!\0".as_ptr()) };
assert_eq!(TRUNCATED, "baz").


` ` ` rust use abi_stable :: sabi_types :: NulStr . const HEWWO : NulStr< ' _ > = unsafe { NulStr :: from_ptr ( " Hello world! \ 0 " . as_ptr () ) } ; assert_eq! ( HEWWO " Hello world! " ) . const TRUNCATED : NulStr< ' _ > = unsafe { NulStr :: from_ptr ( " baz \ 0world! \ 0 " . as_ptr () ) } ; assert_eq! ( TRUNCATED " baz " ) .