Struct xvii::Roman[][src]

pub struct Roman(_);

A Roman numeral.

This struct stores the value of a numeral as an i32 but provides for Roman-style formatting.

Methods

impl Roman
[src]

Creates a Roman value based on an i32.

This function will return None if the value supplied is outside the acceptable range of 1...4999, because numbers outside that range cannot be appropriately formatted using the seven standard numerals.

Creates a Roman value based on an i32.

This function will return any i32 wrapped in a Roman newtype without bothering to check its range, regardless of how unprintable it is.

Note: being "unprintable" is not memory unsafe and will not panic.

Formats a Roman value as an uppercase Roman numeral.

Formats a Roman value as a lowercase Roman numeral.

Methods from Deref<Target = i32>

Trait Implementations

impl Copy for Roman
[src]

impl Clone for Roman
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Roman
[src]

Formats the value using the given formatter. Read more

impl Eq for Roman
[src]

impl PartialEq for Roman
[src]

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

This method tests for !=.

impl Ord for Roman
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for Roman
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for Roman
[src]

Feeds this value into the given [Hasher]. Read more

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

impl AsRef<i32> for Roman
[src]

Performs the conversion.

impl Deref for Roman
[src]

The resulting type after dereferencing.

Dereferences the value.

impl FromStr for Roman
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Display for Roman
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Roman

impl Sync for Roman