pub enum Bom {
Null,
Bocu1,
Gb18030,
Scsu,
UtfEbcdic,
Utf1,
Utf7,
Utf8,
Utf16Be,
Utf16Le,
Utf32Be,
Utf32Le,
}
Expand description
Unicode byte-order mark (BOM) abstraction.
Indicates no BOM was detected.
Indicates BOCU-1 BOM was detected.
Indicates SCSU BOM was detected.
Indicates UTF-1 BOM was detected.
Indicates UTF-7 BOM was detected.
Indicates UTF-8 BOM was detected.
Indicates UTF-16 (big-endian) BOM was detected.
Indicates UTF-16 (little-endian) BOM was detected.
Indicates UTF-32 (big-endian) BOM was detected.
Indicates UTF-32 (little-endian) BOM was detected.
Returns the size in bytes of the BOM.
Returns a &str
representation of the BOM type.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Returns the default/empty BOM type, Bom::Null
.
Formats the BOM type as a String
.
Detect the BOM type from a byte array.
Detect the BOM type from a File
instance.
Note that I/O errors are swallowed by this method.
Instead the default type, Bom::Null
,
will be returned.
A std::io::Error
instance returned by std::fs::File::open
.
Parse the BOM type from the file located at path
.
This method tests for
self
and
other
values to be equal, and is used
by
==
.
Read more
This method tests for
!=
. The default implementation is almost always
sufficient, and should not be overridden without very good reason.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
Converts the given value to a
String
.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.