Crates.io | mbti |
lib.rs | mbti |
version | 0.1.3 |
source | src |
created_at | 2019-05-28 20:28:13.222835 |
updated_at | 2019-05-29 11:05:40.503425 |
description | A library to work with Myer-Briggs personality types |
homepage | |
repository | https://github.com/Pomettini/mbti |
max_upload_size | |
id | 137564 |
size | 34,730 |
A library to work with Myer-Briggs personality types
Myers-Briggs theory is an adaptation of the theory of psychological types produced by Carl Gustav Jung. It is based on 16 personality types, which Jung viewed as stereotypes. They act as useful reference points to understand your unique personality. At the heart of Myers Briggs theory are four preferences. Do you prefer to deal with:
Add this to your Cargo.toml
[dependencies]
mbti = ">=0.1.3"
Get a function from a MBTI type:
extern crate mbti;
use mbti::{get_function, Function, Role, Type};
fn main() {
let primary = get_function(Type::INTP, Role::Primary);
assert_eq!(primary, Function::Ti);
}
Get all the functions from a MBTI type:
extern crate mbti;
use mbti::{get_functions_from_type, Function, Type};
fn main() {
let functions = get_functions_from_type(Type::INTP);
assert_eq!(
functions,
vec![Function::Ti, Function::Ne, Function::Si, Function::Fe]
);
}
Get all the MBTI types from a function role:
extern crate mbti;
use mbti::{get_types_from_function_role, Function, Role, Type};
use std::collections::HashSet;
#[macro_use]
extern crate maplit;
fn main() {
let types = get_types_from_function_role(Function::Fe, Role::Primary);
assert_eq!(types, hashset![Type::ESFJ, Type::ENFJ]);
}
Get a MBTI types from a set of functions:
extern crate mbti;
use mbti::{get_type_from_functions, Function, Type};
fn main() {
let functions =
get_type_from_functions(&[Function::Ti, Function::Ne, Function::Si, Function::Fe]);
assert_eq!(functions, Some(Type::INTP));
}
Get compatibility between two MBTI types:
extern crate mbti;
use mbti::{check_compatibility, Compatibility, Type};
fn main() {
let compatibility = check_compatibility(Type::INTP, Type::INFP);
assert_eq!(compatibility, Compatibility::Positive);
}
The MIT License (MIT)
Copyright © 2019
Giorgio Pomettini
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.