Struct ripline::LineTerminator[][src]

pub struct LineTerminator(_);
Expand description

A line terminator.

A line terminator represents the end of a line. Generally, every line is either “terminated” by the end of a stream or a specific byte (or sequence of bytes).

Generally, a line terminator is a single byte, specifically, \n, on Unix-like systems. On Windows, a line terminator is \r\n (referred to as CRLF for Carriage Return; Line Feed).

The default line terminator is \n on all platforms.

Implementations

Return a new single-byte line terminator. Any byte is valid.

Return a new line terminator represented by \r\n.

When this option is used, consumers may generally treat a lone \n as a line terminator in addition to \r\n.

Returns true if and only if this line terminator is CRLF.

Returns this line terminator as a single byte.

If the line terminator is CRLF, then this returns \n. This is useful for routines that, for example, find line boundaries by treating \n as a line terminator even when it isn’t preceded by \r.

Returns this line terminator as a sequence of bytes.

This returns a singleton sequence for all line terminators except for CRLF, in which case, it returns \r\n.

The slice returned is guaranteed to have length at least 1.

Returns true if and only if the given slice ends with this line terminator.

If this line terminator is CRLF, then this only checks whether the last byte is \n.

Trait Implementations

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 value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.