gettype 1.0.0

A simple function to get the type of a value at runtime.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 1.99 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.03 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • celestifyx/gettype
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CelestifyX

gettype

Overview

gettype is a simple Rust crate that provides a function to retrieve the type of a variable as a string, useful for debugging and logging.

How to use

To use this crate, add it as a dependency in your Cargo.toml:

[dependencies]
gettype = "1.0.0"

Example code:

use gettype::get_type;

fn main() -> () {
    let integer  = 42;
    let floating = 3.14;
    let text     = "Hello, Rust!";

    println!("Type of integer: {}", get_type(&integer));
    println!("Type of floating: {}", get_type(&floating));
    println!("Type of text: {}", get_type(&text));
}

Output:

Type of integer: i32
Type of floating: f64
Type of text: &str