pub fn from_usize(number: usize) -> Option<EntityId> {
    let numberAsString = number.to_string();
    let finalIndex = numberAsString.len();
    if finalIndex != 15 {
      return None
    }
    let kind = numberAsString[finalIndex - 3..finalIndex]
      .parse::<u8>()
      .unwrap();
    let thirdByte = numberAsString[finalIndex - 6..finalIndex - 3]
      .parse::<u8>()
      .unwrap();
    let secondBute = numberAsString[finalIndex - 10..finalIndex - 7]
      .parse::<u8>()
      .unwrap();
    let firstByte = numberAsString[finalIndex - 14..finalIndex - 11]
      .parse::<u8>()
      .unwrap();
    let e: EntityId = EntityId {
      entityKey: [firstByte, secondBute, thirdByte],
      entityKind: EntityKind(kind),
    };
    Some(e)
  }
/// Use this only with usize generated with EntityID::as_usize function.!!!
Use this only with usize generated with EntityID::as_usize function.
Use this only with usize generated with EntityID :: as_usize function .
pub fn from_usize(number: usize) -> Option<EntityId> {
    let numberAsString = number.to_string();
    let finalIndex = numberAsString.len();
    if finalIndex != 15 {
      return None
    }
    let kind = numberAsString[finalIndex - 3..finalIndex]
      .parse::<u8>()
      .unwrap();
    let thirdByte = numberAsString[finalIndex - 6..finalIndex - 3]
      .parse::<u8>()
      .unwrap();
    let secondBute = numberAsString[finalIndex - 10..finalIndex - 7]
      .parse::<u8>()
      .unwrap();
    let firstByte = numberAsString[finalIndex - 14..finalIndex - 11]
      .parse::<u8>()
      .unwrap();
    let e: EntityId = EntityId {
      entityKey: [firstByte, secondBute, thirdByte],
      entityKind: EntityKind(kind),
    };
    Some(e)
  }
pub fn from_usize ( number : usize ) -> Option < EntityId > { let numberAsString = number . to_string ( ) ; let finalIndex = numberAsString . len ( ) ; if finalIndex != 15 { return None } let kind = numberAsString [ finalIndex - 3 .. finalIndex ] . parse :: < u8 > ( ) . unwrap ( ) ; let thirdByte = numberAsString [ finalIndex - 6 .. finalIndex - 3 ] . parse :: < u8 > ( ) . unwrap ( ) ; let secondBute = numberAsString [ finalIndex - 10 .. finalIndex - 7 ] . parse :: < u8 > ( ) . unwrap ( ) ; let firstByte = numberAsString [ finalIndex - 14 .. finalIndex - 11 ] . parse :: < u8 > ( ) . unwrap ( ) ; let e : EntityId = EntityId { entityKey : [ firstByte , secondBute , thirdByte ] , entityKind : EntityKind ( kind ) , } ; Some ( e ) }
Use this only with usize generated with EntityID::as_usize function.!!
Use this only with usize generated with EntityID :: as_usize function . !!
number
usize