size_of_logic

Function size_of_logic 

Source
pub fn size_of_logic<T>() -> Int
Expand description

size_of as a logic Int value.

The definition of size_of_logic guarantees at least the following, based on the documentation of size_of:

  • (), bool, char, primitive integers and floats are known constants.
  • For T: Sized, the pointer and reference types *const T, *mut T, &T, &mut T, Box<T>, Option<&T>, Option<&mut T>, and Option<Box<T>> have the same size as usize.
  • [T; N] has size N * size_of_logic::<T>().

size_of_logic for repr(C) types is not yet implemented.

See also the Rust Reference section on Type Layout.

Note that the value of size_of/size_of_logic may depend on the version of rustc, notably for ADTs with the default representation repr(Rust).

(open, inline)

dead

ensures

0 <= result