[][src]Struct tweep::Warning

pub struct Warning {
    pub warning_type: WarningType,
    pub position: Position,
    pub referent: Option<Position>,
}

Represents a warning with a WarningType, Position, and optionally a reference to another Position

Fields

warning_type: WarningType

The warning type

position: Position

The location of the warning

referent: Option<Position>

The location referenced by this warning

Methods

impl Warning[src]

pub fn new(warning_type: WarningType) -> Self[src]

Creates a new Warning with a default Position and no referent

pub fn has_referent(&self) -> bool[src]

Returns true if this Warning has a referent

pub fn get_referent(&self) -> Option<&Position>[src]

Gets the referent if one exists

pub fn set_referent(&mut self, referent: Position)[src]

Sets the referent to the given Position

pub fn with_referent(self, referent: Position) -> Self[src]

Moves the object, sets the referent to the given Position, and returns the modified object

Trait Implementations

impl Clone for Warning[src]

impl Debug for Warning[src]

impl Display for Warning[src]

impl Eq for Warning[src]

impl PartialEq<Warning> for Warning[src]

impl Positional for Warning[src]

impl StructuralEq for Warning[src]

impl StructuralPartialEq for Warning[src]

Auto Trait Implementations

impl RefUnwindSafe for Warning

impl Send for Warning

impl Sync for Warning

impl Unpin for Warning

impl UnwindSafe for Warning

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.