Trait chomp::ascii::Float
[−]
[src]
pub trait Float<B: Buffer<Token = u8>>: Sized {
unsafe fn parse_buffer<I: Input<Token = u8, Buffer = B>>(
i: I,
b: B
) -> SimpleResult<I, Self>;
}Trait enabling the conversion from a matched Buffer to a float of the correct type.
Required Methods
unsafe fn parse_buffer<I: Input<Token = u8, Buffer = B>>(
i: I,
b: B
) -> SimpleResult<I, Self>
i: I,
b: B
) -> SimpleResult<I, Self>
Given an input and a buffer matching /[+-]?[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)/,
convert this buffer into the proper float-representation, error if it is not possible
to determine the correct representation.
NOTES:
- Unsafe because the
parse_bufferimplementation should be able to rely on the format of the incoming buffer (including well-formed UTF-8).