var searchIndex = {}; searchIndex["encode_unicode"] = {"doc":"Alternative and extension to the unstable `char.encode_utf8()` and `char.encode_utf16()`.","items":[[3,"Utf8Char","encode_unicode","Store a `char` as UTF-8 so it can be borrowed as a `str`",null,null],[3,"Utf16Char","","Store a `char` as UTF-16 so it can be borrowed as a slice",null,null],[3,"Utf8Iterator","","Read or iterate over the bytes in the UTF-8 representation of a codepoint.",null,null],[3,"Utf16Iterator","","Iterate over the units in an UTF-16 representation of a codepoint.",null,null],[11,"default","","",0,{"inputs":[],"output":{"name":"utf8char"}}],[11,"cmp","","",0,null],[11,"partial_cmp","","",0,null],[11,"lt","","",0,null],[11,"le","","",0,null],[11,"gt","","",0,null],[11,"ge","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"clone","","",0,null],[11,"from_str","","The string must contain exactly one codepoint",0,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"from","","",0,{"inputs":[{"name":"char"}],"output":{"name":"self"}}],[11,"into_iter","","Iterate over the byte values.",0,null],[11,"as_ref","","",0,null],[11,"as_ref","","",0,null],[11,"borrow","","",0,null],[11,"borrow","","",0,null],[11,"deref","","",0,null],[11,"hash","","",0,null],[11,"fmt","","",0,null],[11,"from_slice_start","","Validate the start of a UTF-8 slice and store it.\nAlso returns how many bytes were needed.",0,null],[11,"from_array","","Validate the array and store it.",0,null],[11,"len","","Result is 1...4 and identical to `.as_ref().len()` or `.as_char().len_utf8()`.\nThere is no .is_emty() because it would always return false.",0,null],[11,"to_char","","Convert from UTF-8 to UTF-32",0,null],[11,"to_slice","","Write the internal representation to a slice,\nand then returns the number of bytes written.",0,null],[11,"to_array","","Expose the internal array and the number of used bytes.",0,null],[11,"clone","","",1,null],[11,"from","","",1,{"inputs":[{"name":"utf8char"}],"output":{"name":"self"}}],[11,"from","","",1,{"inputs":[{"name":"char"}],"output":{"name":"self"}}],[11,"next","","",1,null],[11,"size_hint","","",1,null],[11,"len","","",1,null],[11,"read","","Always returns Ok",1,null],[11,"fmt","","",1,null],[11,"default","","",2,{"inputs":[],"output":{"name":"utf16char"}}],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"clone","","",2,null],[11,"from","","",2,{"inputs":[{"name":"char"}],"output":{"name":"self"}}],[11,"into_iter","","Iterate over the units.",2,null],[11,"as_ref","","",2,null],[11,"borrow","","",2,null],[11,"deref","","",2,null],[11,"hash","","",2,null],[11,"fmt","","",2,null],[11,"partial_cmp","","",2,null],[11,"cmp","","",2,null],[11,"from_slice","","Validate and store the first UTF-16 codepoint in the slice.\nAlso return how many units were needed.",2,null],[11,"from_tuple","","Validate and store a UTF-16 pair as returned from `char.to_utf16_tuple()`.",2,null],[11,"len","","Returns 1 or 2.\nThere is no `.is_emty()` because it would always return false.",2,null],[11,"to_char","","Convert from UTF-16 to UTF-32",2,null],[11,"to_slice","","Write the internal representation to a slice,\nand then returns the number of `u16`s written.",2,null],[11,"to_tuple","","The second `u16` is used for surrogate pairs.",2,null],[11,"clone","","",3,null],[11,"from","","",3,{"inputs":[{"name":"char"}],"output":{"name":"self"}}],[11,"from","","",3,{"inputs":[{"name":"utf16char"}],"output":{"name":"self"}}],[11,"next","","",3,null],[11,"size_hint","","",3,null],[11,"len","","",3,null],[11,"fmt","","",3,null],[0,"error","","Errors returned by various conversion methods in this crate.",null,null],[4,"FromStrError","encode_unicode::error","Reason why Utf8Char::from_str() failed.",null,null],[13,"SeveralCodePoints","","Utf8Char cannot store more than a single codepoint.",4,null],[13,"Empty","","Utf8Char cannot be empty.",4,null],[4,"InvalidCodePoint","","Reasons why an u32 is not a valid utf codepoint.",null,null],[13,"Utf16Reserved","","It's reserved for utf-16 surrogate pairs.",5,null],[13,"TooHigh","","It's higher than the highest codepoint of 0x10ffff.",5,null],[4,"InvalidUtf8FirstByte","","Reasons why a byte is not the start of a UTF-8 codepoint.",null,null],[13,"TooLongSeqence","","Sequences cannot be longer than 4 bytes. Is given for bytes >= 240.",6,null],[13,"ContinuationByte","","This byte belongs to a previous seqence. Is given for values between 128 and 192 (exclusive).",6,null],[4,"InvalidUtf8","","Reasons why a byte sequence is not valid UTF-8, excluding invalid codepoint.\nIn sinking precedence.",null,null],[13,"FirstByte","","Something is certainly wrong with the first byte.",7,null],[13,"NotAContinuationByte","","One of the continuation bytes doesnt fit the pattern 0b10xx_xxxx.",7,null],[13,"OverLong","","There are too many leading zeros; it could be a byte shorter.",7,null],[4,"InvalidUtf8Slice","","Reasons why a byte slice is not valid UTF-8, in sinking precedence.",null,null],[13,"Utf8","","Something is certainly wrong with the first byte.",8,null],[13,"CodePoint","","The encoded codepoint is invalid:",8,null],[13,"TooShort","","The slice is too short; n bytes was required.",8,null],[4,"InvalidUtf16Slice","","Reasons why a slice of `u16`s doesn't start with valid UTF-16.",null,null],[13,"EmptySlice","","The slice is empty.",9,null],[13,"FirstLowSurrogate","","The first unit is a low surrogate.",9,null],[13,"MissingSecond","","The first and only unit requires a second unit.",9,null],[13,"SecondNotLowSurrogate","","The first unit requires a second one, but it's not a low surrogate.",9,null],[4,"InvalidUtf8Array","","Reasons why a byte array is not valid UTF-8, in sinking precedence.",null,null],[13,"Utf8","","Something is certainly wrong with the first byte.",10,null],[13,"CodePoint","","The encoded codepoint is invalid:",10,null],[4,"InvalidUtf16Tuple","","Reasons why one or two `u16`s are not valid UTF-16, in sinking precedence.",null,null],[13,"FirstIsTrailingSurrogate","","The first unit is a trailing/low surrogate, which is never valid.",11,null],[13,"SuperfluousSecond","","You provided a second unit, but the first one stands on its own.",11,null],[13,"MissingSecond","","The first and only unit requires a second unit.",11,null],[13,"InvalidSecond","","The first unit requires a second unit, but it's not a trailing/low surrogate.",11,null],[8,"CharExt","encode_unicode","Extension trait for `char` that adds methods for converting to and from UTF-8 or UTF-16.",null,null],[10,"to_utf8","","Get the UTF-8 representation of this codepoint.",12,null],[10,"to_utf16","","Get the UTF-16 representation of this codepoint.",12,null],[10,"iter_utf8_bytes","","Iterate over or [read](https://doc.rust-lang.org/std/io/trait.Read.html)\nthe one to four bytes in the UTF-8 representation of this codepoint.",12,null],[10,"iter_utf16_units","","Iterate over the one or two units in the UTF-16 representation of this codepoint.",12,null],[10,"to_utf8_slice","","Convert this char to UTF-8, and then\nreturns the number of bytes written.",12,null],[10,"to_utf16_slice","","Convert this char to UTF-16, and then\nreturns the number of units written.",12,null],[10,"to_utf8_array","","Convert this char to an UTF-8 array and lenght,\nThe returned array is left-aligned, and the usize is how many bytes are used.\nThe unused bytes are zero.",12,null],[10,"to_utf16_tuple","","Convert this char to UTF-16.\nThe second `u16` is `Some` if a surrogate pair is required.",12,null],[10,"from_utf8_slice","","Create a `char` from the start of a slice intepreted as UTF-8, and return how many bytes were needed.",12,null],[10,"from_utf16_slice","","Read one or two UTF-16 units into a `char`, and also return how many units were needed.",12,null],[10,"from_utf8_array","","Convert an UTF-8 sequence as returned from `.to_utf8_array()` into a `char`",12,null],[10,"from_utf16_tuple","","Convert a UTF-16 pair as returned from `.to_utf16_tuple()` into a `char`.",12,null],[10,"from_utf8_exact_slice_unchecked","","Convert an UTF-8 sequence into a char.\nThe length of the slice is the length of the sequence, should be 1,2,3 or 4.",12,null],[10,"from_utf16_tuple_unchecked","","Convert a UTF-16 tuple as returned from `.to_utf16_tuple()` into a `char`.",12,null],[10,"from_u32_detailed","","Perform some extra validations compared to `char::from_u32_unchecked()`",12,{"inputs":[{"name":"u32"}],"output":{"name":"result"}}],[8,"U8UtfExt","","Methods for working with `u8`s UTF-8.",null,null],[10,"extra_utf8_bytes","","How many more bytes will you need to complete this codepoint?\nFailures:",13,null],[10,"extra_utf8_bytes_unchecked","","How many more bytes will you need to complete this codepoint?\nAssumes that self is a valid UTF-8 start.\nReturns `self.not().leading_zeros().saturating_sub(1)`",13,null],[8,"U16UtfExt","","Methods for working with `u16`s as UTF-16 units.",null,null],[10,"utf16_needs_extra_unit","","Will you need an extra unit to complete this codepoint?",14,null],[10,"utf16_is_leading_surrogate","","Does this `u16` need another `u16` to complete a codepoint?\nReturns `(self & 0xfc00) == 0xd800`",14,null],[11,"eq","encode_unicode::error","",4,null],[11,"fmt","","",4,null],[11,"clone","","",4,null],[11,"description","","",4,null],[11,"fmt","","",4,null],[11,"eq","","",5,null],[11,"fmt","","",5,null],[11,"clone","","",5,null],[11,"error_range","","Get the range of values for which this error would be given.",5,null],[11,"description","","",5,null],[11,"fmt","","",5,null],[11,"eq","","",6,null],[11,"fmt","","",6,null],[11,"clone","","",6,null],[11,"description","","",6,null],[11,"fmt","","",6,null],[11,"eq","","",7,null],[11,"ne","","",7,null],[11,"fmt","","",7,null],[11,"clone","","",7,null],[11,"description","","",7,null],[11,"cause","","When `Some` is returned, the `Error` is a `InvalidUtf8FirstByte`.",7,null],[11,"fmt","","",7,null],[11,"eq","","",10,null],[11,"ne","","",10,null],[11,"fmt","","",10,null],[11,"clone","","",10,null],[11,"description","","",10,null],[11,"cause","","Always returns `Some`.",10,null],[11,"fmt","","",10,null],[11,"eq","","",8,null],[11,"ne","","",8,null],[11,"fmt","","",8,null],[11,"clone","","",8,null],[11,"description","","",8,null],[11,"cause","","",8,null],[11,"fmt","","",8,null],[11,"eq","","",11,null],[11,"fmt","","",11,null],[11,"clone","","",11,null],[11,"description","","",11,null],[11,"fmt","","",11,null],[11,"eq","","",9,null],[11,"fmt","","",9,null],[11,"clone","","",9,null],[11,"description","","",9,null],[11,"fmt","","",9,null]],"paths":[[3,"Utf8Char"],[3,"Utf8Iterator"],[3,"Utf16Char"],[3,"Utf16Iterator"],[4,"FromStrError"],[4,"InvalidCodePoint"],[4,"InvalidUtf8FirstByte"],[4,"InvalidUtf8"],[4,"InvalidUtf8Slice"],[4,"InvalidUtf16Slice"],[4,"InvalidUtf8Array"],[4,"InvalidUtf16Tuple"],[8,"CharExt"],[8,"U8UtfExt"],[8,"U16UtfExt"]]}; initSearch(searchIndex);