Enum unicode_bom::Bom

source ·
pub enum Bom {
    Null,
    Bocu1,
    Gb18030,
    Scsu,
    UtfEbcdic,
    Utf1,
    Utf7,
    Utf8,
    Utf16Be,
    Utf16Le,
    Utf32Be,
    Utf32Le,
}
Expand description

Unicode byte-order mark (BOM) abstraction.

Variants§

§

Null

Indicates no BOM was detected.

§

Bocu1

Indicates BOCU-1 BOM was detected.

§

Gb18030

Indicates GB 18030 BOM was detected.

§

Scsu

Indicates SCSU BOM was detected.

§

UtfEbcdic

Indicates UTF-EBCIDC BOM was detected.

§

Utf1

Indicates UTF-1 BOM was detected.

§

Utf7

Indicates UTF-7 BOM was detected.

§

Utf8

Indicates UTF-8 BOM was detected.

§

Utf16Be

Indicates UTF-16 (big-endian) BOM was detected.

§

Utf16Le

Indicates UTF-16 (little-endian) BOM was detected.

§

Utf32Be

Indicates UTF-32 (big-endian) BOM was detected.

§

Utf32Le

Indicates UTF-32 (little-endian) BOM was detected.

Implementations§

Returns the size in bytes of the BOM.

Trait Implementations§

Returns a &str representation of the BOM type.

Returns a copy of the value. Read more
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

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. 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.