Crate is_slice

Source
Expand description

§Module :: is_slice

experimental rust-status docs.rs Open in Gitpod discord

Macro to answer the question: is it a slice?

§Basic use-case

use is_slice::*;

dbg!( is_slice!( Box::new( true ) ) );
// < is_slice!(Box :: new(true)) = false
dbg!( is_slice!( &[ 1, 2, 3 ] ) );
// < is_slice!(& [1, 2, 3]) = false
dbg!( is_slice!( &[ 1, 2, 3 ][ .. ] ) );
// < is_slice!(& [1, 2, 3] [..]) = true

§To add to your project

cargo add is_slice

§Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/is_slice_trivial
cargo run

Modules§

exposed
Exposed namespace of the module.
orphan
Orphan namespace of the module.
own
Own namespace of the module.
prelude
Prelude to use essentials: use my_module::prelude::*.

Macros§

is_slice
Macro to answer the question: is it a slice?