Trait WithC8Str

Source
pub trait WithC8Str: Sized {
    type Error;

    // Required method
    fn with_c8_str<R>(
        self,
        f: impl FnOnce(&C8Str) -> R,
    ) -> Result<R, Self::Error>;
}
Expand description

Access an object as a &C8Str

Required Associated Types§

Source

type Error

Error type

Required Methods§

Source

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Access this object as a &C8Str

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl WithC8Str for &str

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &CString

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &String

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &CStr

Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &mut str

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &mut CString

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &mut String

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for &mut CStr

Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for CString

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl WithC8Str for String

Available on crate feature alloc only.
Source§

type Error = C8StrError

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl<'a, T: ?Sized> WithC8Str for &'a &'a mut T

Source§

type Error = <&'a T as WithC8Str>::Error

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl<'a, T: ?Sized> WithC8Str for &'a mut &'a mut T

Source§

type Error = <&'a T as WithC8Str>::Error

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl<'a, T: ?Sized> WithC8Str for &&'a T

Source§

type Error = <&'a T as WithC8Str>::Error

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Source§

impl<'a, T: ?Sized> WithC8Str for &mut &'a T

Source§

type Error = <&'a T as WithC8Str>::Error

Source§

fn with_c8_str<R>(self, f: impl FnOnce(&C8Str) -> R) -> Result<R, Self::Error>

Implementors§

Source§

impl WithC8Str for &C8Str

Source§

impl WithC8Str for &C8String

Available on crate feature alloc only.
Source§

impl WithC8Str for &mut C8Str

Source§

impl WithC8Str for &mut C8String

Available on crate feature alloc only.
Source§

impl WithC8Str for C8String

Available on crate feature alloc only.