var searchIndex = {}; searchIndex["twelve_bit"] = {"doc":"# The U12 Library","items":[[0,"u12","twelve_bit","",null,null],[3,"U12","twelve_bit::u12","",null,null],[17,"MAX","","The largest value representable by the `U12` type.",null,null],[17,"MIN","","The smallest value representable by the `U12` type.",null,null],[8,"FailableInto","","Trait for implementing failable conversions in a generic way.",null,null],[10,"failable_into","","Returns the receiver as `Some(T)` if non-truncating, or `None`.",0,null],[11,"unchecked_into","","Returns the receiver as `T` by using `failable_into()` and unwrapping the result.",0,null],[11,"cmp","","",1,null],[11,"partial_cmp","","",1,null],[11,"lt","","",1,null],[11,"le","","",1,null],[11,"gt","","",1,null],[11,"ge","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"clone","","",1,null],[11,"fmt","","",1,null],[11,"min_value","","Returns the smallest value that can be represented by this integer type.",1,{"inputs":[],"output":{"name":"self"}}],[11,"max_value","","Returns the largest value that can be represented by this integer type.",1,{"inputs":[],"output":{"name":"self"}}],[11,"count_ones","","Returns the number of ones in the binary representation of `self`.\n# Examples\nBasic usage:",1,null],[11,"count_zeros","","Returns the number of zeros in the binary representation of `self`.\n# Examples\nBasic usage:",1,null],[11,"leading_zeros","","Returns the number of leading zeros in the binary representation of `self`.\n# Examples\nBasic usage:",1,null],[11,"trailing_zeros","","Returns the number of trailing zeros in the binary representation of `self`.\n# Examples\nBasic usage:",1,null],[11,"checked_add","","Checked integer addition.\nComputes `self + other`, returning `None` if overflow occurred.",1,null],[11,"saturating_add","","Saturating integer addition.\nComputes `self + other`, saturating at the numeric bounds instead of overflowing.",1,null],[11,"wrapping_add","","Wrapping (modular) addition.\nComputes `self + other`, wrapping around at the boundary of the type.",1,null],[11,"overflowing_add","","Overflowing addition.\nComputes `self + other`, returning a tuple of the addition along with a \nboolean indicating whether an arithmetic overflow would occur. \nIf an overflow would have occurred then the wrapped value is returned.",1,null],[11,"checked_sub","","Checked integer subtraction.\nComputes `self - other`, returning `None` if underflow occurred.",1,null],[11,"saturating_sub","","Saturating integer subtraction.\nComputes `self - other`, saturating at the numeric bounds instead of overflowing.",1,null],[11,"wrapping_sub","","Wrapping (modular) subtraction.\nComputes `self - other`, wrapping around at the boundary of the type.",1,null],[11,"overflowing_sub","","Overflowing subtraction.\nComputes `self - other`, returning a tuple of the subtraction result along with a \nboolean indicating whether an arithmetic underflow would occur.\nIf an underflow would have occurred then the wrapped value is returned.",1,null],[11,"checked_mul","","Checked integer multiplication.\nComputes `self * other`, returning `None` if overflow occurred.",1,null],[11,"saturating_mul","","Saturating integer multiplication.\nComputes `self * other`, saturating at the numeric bounds instead of overflowing.",1,null],[11,"wrapping_mul","","Wrapping (modular) multiplication.\nComputes `self * other`, wrapping around at the boundary of the type.",1,null],[11,"overflowing_mul","","Overflowing multiplication.\nReturns a tuple of the multiplication along with a boolean indicating whether an arithmetic \noverflow would occur. If an overflow would have occurred then the wrapped value is returned.",1,null],[11,"checked_div","","Checked integer division.\nComputes `self / other`, returning None if other == 0 or the operation results in \nunderflow or overflow.",1,null],[11,"wrapping_div","","Wrapping (modular) division.\nComputes self / other. Wrapped division on unsigned types is just normal division. \nThere's no way wrapping could ever happen. This function exists, so that all operations \nare accounted for in the wrapping operations.",1,null],[11,"overflowing_div","","Calculates the divisor when the receiver is divided by `rhs`.\nReturns a tuple of the divisor along with a boolean indicating whether an arithmetic \noverflow would occur. Note that for unsigned integers overflow never occurs, \nso the second value is always false.",1,null],[11,"checked_neg","","Checked integer negation.\nComputes `-self`, returning `None` unless `self == 0`.\nNote that negating any positive integer will overflow.",1,null],[11,"wrapping_neg","","Wrapping (modular) negation.\nComputes `-self`, wrapping around at the boundary of the type.",1,null],[11,"overflowing_neg","","Negates self in an overflowing fashion.\nReturns `!self + 1` using wrapping operations to return the value that \nrepresents the negation of this unsigned value. Note that for positive \nunsigned values overflow always occurs, but negating `0` does not overflow.",1,null],[11,"checked_rem","","Checked integer remainder.\nComputes `self % other`, returning `None` if `other == 0` or the \noperation results in underflow or overflow.",1,null],[11,"wrapping_rem","","Wrapping (modular) integer remainder.\nComputes `self % other`. Wrapped remainder calculation on unsigned types \nis just the regular remainder calculation. There's no way wrapping could ever \nhappen. This function exists, so that all operations are accounted for in the \nwrapping operations.",1,null],[11,"overflowing_rem","","Calculates the remainder when `self` is divided by `other`.\nReturns a tuple of the remainder after dividing along with a boolean indicating \nwhether an arithmetic overflow would occur. Note that for unsigned integers \noverflow never occurs, so the second value is always false.",1,null],[11,"checked_shl","","Checked shift left.\nComputes `self << rhs`, returning `None` if `rhs` is larger than or equal to \nthe number of bits in the receiver.",1,null],[11,"wrapping_shl","","Panic-free bitwise shift-left; yields `self << mask(rhs)`, where mask removes any\nhigh-order bits of rhs that would cause the shift to exceed the bitwidth of the type.",1,null],[11,"overflowing_shl","","Shifts self left by rhs bits.\nReturns a tuple of the shifted version of the receiver along with a boolean\nindicating whether the shift value was larger than or equal to the number of\nbits. If the shift value is too large, then value is masked `(N-1)` where N\nis the number of bits, and this value is then used to perform the shift.",1,null],[11,"checked_shr","","Checked shift right.\nComputes `self >> rhs`, returning `None` if `rhs` is larger than or \nequal to the number of bits in the receiver.",1,null],[11,"wrapping_shr","","Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where mask removes any\nhigh-order bits of rhs that would cause the shift to exceed the bitwidth of the type.",1,null],[11,"overflowing_shr","","Shifts the receiver right by `rhs` bits.\nReturns a tuple of the shifted version of self along with a boolean indicating \nwhether the shift value was larger than or equal to the number of bits. \nIf the shift value is too large, then value is masked `(N-1)` where `N` is the \nnumber of bits, and this value is then used to perform the shift.",1,null],[11,"checked_bitand","","Checked bitwise-and of the receiver with `rhs`.\nComputes `self & rhs`. This method cannot fail.",1,null],[11,"checked_bitor","","Checked bitwise-or of the receiver with `rhs`.\nComputes `self | rhs`. This method cannot fail.",1,null],[11,"checked_bitxor","","Checked bitwise-xor of the receiver with `rhs`.\nComputes `self ^ rhs`. This method cannot fail.",1,null],[11,"from","","",1,{"inputs":[{"name":"u8"}],"output":{"name":"self"}}],[11,"default","","",1,{"inputs":[],"output":{"name":"self"}}],[11,"add","","",1,null],[11,"add","","",1,null],[11,"sub","","",1,null],[11,"sub","","",1,null],[11,"mul","","",1,null],[11,"mul","","",1,null],[11,"div","","",1,null],[11,"div","","",1,null],[11,"rem","","",1,null],[11,"rem","","",1,null],[11,"not","","",1,null],[11,"bitand","","",1,null],[11,"bitand","","",1,null],[11,"bitor","","",1,null],[11,"bitor","","",1,null],[11,"bitxor","","",1,null],[11,"bitxor","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shl","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[11,"shr","","",1,null],[14,"u12!","twelve_bit","Creates a 12-bit value via unchecked-into conversion.\nThis is meant to simplify describing U12 literal values, as the\n`$x` parameter is first bound to a 16-bit value. This allows the compiler to\nelide the type of the literal, and does compile-time validation that no\nliteral greater than `0xFFFF` is specified; this will panic for values\nin the range `0x1000...0xFFFF`.",null,null]],"paths":[[8,"FailableInto"],[3,"U12"]]}; initSearch(searchIndex);