to-be
Simple Rust library determining the truthyness of strings, that is whether they indicate truey or falsy values.
Introduction
to-be is a library providing facilities for determine whether the truthyness of strings. It implemented in several languages: to-be.Rust is the Rust implementation.
Terminology
The term "truthy" is an unhelpfully overloaded term in the programming world, insofar as it is used to refer to the notion of "truthyness" - whether something can be deemed to be interpretable as truth - and also the true side of that interpretation. In this library, the former interpretation is used, leaving us with the following terms:
- "truthy" - whether something can be can be deemed to be interpretable as having truth;
- "falsey" - whether an object can be deemed to be interpretable as being false;
- "truey" - whether an object can be deemed to be interpretable as being true;
For example, consider the following Rust program:
let s1 = "no";
let s2 = "True";
let s3 = "orange";
// "no" is validly truthy, and is falsey
assert_eq!;
assert_eq!;
// "True" is validly truthy, and is truey
assert_eq!;
assert_eq!;
// "orange" is not validly truthy, and is neither falsey nor truey
assert_eq!;
assert_eq!;
Table of Contents
Installation
Reference in Cargo.toml in the usual way:
= { = "0" }
Components
Constants
No public constants are defined at this time.
Enumerations
No public enumerations are defined at this time.
Features
No public crate-specific features are defined at this time.
Functions
The following public functions are defined in the current version:
;
;
;
;
;
Macros
No public macros are defined at this time.
Structures
The following public structures are defined in the current version:
Traits
The following public traits are defined in the current version:
Further, Truthy is implemented for any type for which base-traits' AsStr trait is defined, e.g.
use Truthy as _;
let s : String = "yes".into;
assert!;
Examples
No example programs are provided at this time.
Project Information
Where to get help
Contribution guidelines
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/to-be.Rust.
Dependencies
Crates upon which to-be.Rust has runtime dependencies:
Dev Dependencies
to-be.Rust has no (additional) development dependencies.
Related projects
- to-be (C);
- to-be.Python;
- to-be.Ruby;
License
to-be.Rust is released under the 3-clause BSD license. See LICENSE for details.