Skip to main content

Basic

Trait Basic 

Source
pub trait Basic: Type {
    const SIGNATURE_CHAR: char;
    const SIGNATURE_STR: &'static str;

    // Provided method
    fn alignment(format: Format) -> usize { ... }
}
Expand description

Trait for basic types.

All basic types are also Type implementers.

Required Associated Constants§

Source

const SIGNATURE_CHAR: char

The type signature, as a character.

Source

const SIGNATURE_STR: &'static str

The type signature, as a string.

Provided Methods§

Source

fn alignment(format: Format) -> usize

The required padding alignment for the given format.

The default implementation covers all possible cases so you should never need to override it.

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 Basic for bool

Source§

const SIGNATURE_CHAR: char = 'b'

Source§

const SIGNATURE_STR: &'static str = "b"

Source§

impl Basic for char

Source§

const SIGNATURE_CHAR: char = <&str>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <&str>::SIGNATURE_STR

Source§

impl Basic for f32

Source§

const SIGNATURE_CHAR: char = f64::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = f64::SIGNATURE_STR

Source§

impl Basic for f64

Source§

const SIGNATURE_CHAR: char = 'd'

Source§

const SIGNATURE_STR: &'static str = "d"

Source§

impl Basic for i8

Source§

const SIGNATURE_CHAR: char = i16::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = i16::SIGNATURE_STR

Source§

impl Basic for i16

Source§

const SIGNATURE_CHAR: char = 'n'

Source§

const SIGNATURE_STR: &'static str = "n"

Source§

impl Basic for i32

Source§

const SIGNATURE_CHAR: char = 'i'

Source§

const SIGNATURE_STR: &'static str = "i"

Source§

impl Basic for i64

Source§

const SIGNATURE_CHAR: char = 'x'

Source§

const SIGNATURE_STR: &'static str = "x"

Source§

impl Basic for isize

Source§

const SIGNATURE_CHAR: char = <i64 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <i64 as Basic>::SIGNATURE_STR

Source§

impl Basic for str

Source§

const SIGNATURE_CHAR: char = 's'

Source§

const SIGNATURE_STR: &'static str = "s"

Source§

impl Basic for u8

Source§

const SIGNATURE_CHAR: char = 'y'

Source§

const SIGNATURE_STR: &'static str = "y"

Source§

impl Basic for u16

Source§

const SIGNATURE_CHAR: char = 'q'

Source§

const SIGNATURE_STR: &'static str = "q"

Source§

impl Basic for u32

Source§

const SIGNATURE_CHAR: char = 'u'

Source§

const SIGNATURE_STR: &'static str = "u"

Source§

impl Basic for u64

Source§

const SIGNATURE_CHAR: char = 't'

Source§

const SIGNATURE_STR: &'static str = "t"

Source§

impl Basic for usize

Source§

const SIGNATURE_CHAR: char = <u64 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <u64 as Basic>::SIGNATURE_STR

Source§

impl Basic for String

Source§

const SIGNATURE_CHAR: char = 's'

Source§

const SIGNATURE_STR: &'static str = "s"

Source§

impl Basic for AtomicBool

Available on target_has_atomic=8 only.
Source§

const SIGNATURE_CHAR: char = <bool as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <bool as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicI8

Available on target_has_atomic=8 only.
Source§

const SIGNATURE_CHAR: char = <i8 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <i8 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicI16

Available on target_has_atomic=16 only.
Source§

const SIGNATURE_CHAR: char = <i16 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <i16 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicI32

Available on target_has_atomic=32 only.
Source§

const SIGNATURE_CHAR: char = <i32 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <i32 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicI64

Available on target_has_atomic=64 only.
Source§

const SIGNATURE_CHAR: char = <i64 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <i64 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicIsize

Available on target_has_atomic=ptr only.
Source§

const SIGNATURE_CHAR: char = <isize as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <isize as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicU8

Available on target_has_atomic=8 only.
Source§

const SIGNATURE_CHAR: char = <u8 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <u8 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicU16

Available on target_has_atomic=16 only.
Source§

const SIGNATURE_CHAR: char = <u16 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <u16 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicU32

Available on target_has_atomic=32 only.
Source§

const SIGNATURE_CHAR: char = <u32 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <u32 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicU64

Available on target_has_atomic=64 only.
Source§

const SIGNATURE_CHAR: char = <u64 as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <u64 as Basic>::SIGNATURE_STR

Source§

impl Basic for AtomicUsize

Available on target_has_atomic=ptr only.
Source§

const SIGNATURE_CHAR: char = <usize as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <usize as Basic>::SIGNATURE_STR

Source§

impl Basic for NonZeroI8

Source§

const SIGNATURE_CHAR: char = i8::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = i8::SIGNATURE_STR

Source§

impl Basic for NonZeroI16

Source§

const SIGNATURE_CHAR: char = i16::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = i16::SIGNATURE_STR

Source§

impl Basic for NonZeroI32

Source§

const SIGNATURE_CHAR: char = i32::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = i32::SIGNATURE_STR

Source§

impl Basic for NonZeroI64

Source§

const SIGNATURE_CHAR: char = i64::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = i64::SIGNATURE_STR

Source§

impl Basic for NonZeroU8

Source§

const SIGNATURE_CHAR: char = u8::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = u8::SIGNATURE_STR

Source§

impl Basic for NonZeroU16

Source§

const SIGNATURE_CHAR: char = u16::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = u16::SIGNATURE_STR

Source§

impl Basic for NonZeroU32

Source§

const SIGNATURE_CHAR: char = u32::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = u32::SIGNATURE_STR

Source§

impl Basic for NonZeroU64

Source§

const SIGNATURE_CHAR: char = u64::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = u64::SIGNATURE_STR

Source§

impl<T: Basic> Basic for Reverse<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: Basic> Basic for Saturating<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: Basic> Basic for Wrapping<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic + ToOwned> Basic for Cow<'_, T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for &T

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for &mut T

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Box<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Rc<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Weak<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Arc<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Weak<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Cell<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for RefCell<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for Mutex<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<T: ?Sized + Basic> Basic for RwLock<T>

Source§

const SIGNATURE_CHAR: char = T::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = T::SIGNATURE_STR

Source§

impl<const CAP: usize> Basic for String<CAP>

Available on crate feature heapless only.
Source§

const SIGNATURE_CHAR: char = <&str as Basic>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <&str as Basic>::SIGNATURE_STR

Implementors§

Source§

impl Basic for Fd<'_>

Source§

const SIGNATURE_CHAR: char = 'h'

Source§

const SIGNATURE_STR: &'static str = "h"

Source§

impl Basic for Signature

Source§

const SIGNATURE_CHAR: char = 'g'

Source§

const SIGNATURE_STR: &'static str = "g"

Source§

impl Basic for ObjectPath<'_>

Source§

const SIGNATURE_CHAR: char = 'o'

Source§

const SIGNATURE_STR: &'static str = "o"

Source§

impl Basic for OwnedFd

Source§

const SIGNATURE_CHAR: char = 'h'

Source§

const SIGNATURE_STR: &'static str = "h"

Source§

impl Basic for OwnedObjectPath

Source§

const SIGNATURE_CHAR: char = ObjectPath::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = ObjectPath::SIGNATURE_STR

Source§

impl Basic for Str<'_>

Source§

const SIGNATURE_CHAR: char = <&str>::SIGNATURE_CHAR

Source§

const SIGNATURE_STR: &'static str = <&str>::SIGNATURE_STR