Struct bijection::Bijection [] [src]

pub struct Bijection { /* fields omitted */ }

Methods

impl Bijection
[src]

impl Bijection
[src]

Converts a string.

Example

let result = Bijection::new("example").convert_string("Example string");

Converts an unsigned 8-bit integer.

Example

let result = Bijection::new("example").convert_u8(u8::max_value());

Converts an unsigned 16-bit integer.

Example

let result = Bijection::new("example").convert_u16(u16::max_value());

Converts an unsigned 32-bit integer.

Example

let result = Bijection::new("example").convert_u32(u32::max_value());

Converts an unsigned 64-bit integer.

Example

let result = Bijection::new("example").convert_u64(u64::max_value());

impl Bijection
[src]

Reverts a string.

Example

  let mut bijection = Bijection::new("example");
  let converted_value = bijection.convert_string("Example string").unwrap();
  let result = bijection.revert_string(&converted_value);

Reverts an unsigned 8-bit integer.

Example

  let mut bijection = Bijection::new("example");
  let converted_value = bijection.convert_u8(u8::max_value()).unwrap();
  let result = Bijection::new("example").revert_u8(array_ref!(converted_value, 0, 1));

Reverts an unsigned 16-bit integer.

Example

  let mut bijection = Bijection::new("example");
  let converted_value = bijection.convert_u16(u16::max_value()).unwrap();
  let result = Bijection::new("example").revert_u16(array_ref!(converted_value, 0, 2));

Reverts an unsigned 8-bit integer.

Example

  let mut bijection = Bijection::new("example");
  let converted_value = bijection.convert_u32(u32::max_value()).unwrap();
  let result = Bijection::new("example").revert_u32(array_ref!(converted_value, 0, 4));

Reverts an unsigned 8-bit integer.

Example

  let mut bijection = Bijection::new("example");
  let converted_value = bijection.convert_u64(u64::max_value()).unwrap();
  let result = Bijection::new("example").revert_u64(array_ref!(converted_value, 0, 8));

impl Bijection
[src]

Converts a byte array.

Example

let result = Bijection::new("example").convert_bytes("Example string".as_bytes());

Reverts a byte array.

Example

  let mut bijection = Bijection::new("example");
  let converted_value = bijection.convert_bytes("Example string".as_bytes()).unwrap();
  let result = bijection.revert_bytes(&converted_value);