[−][src]Struct tweep::Warning
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]
fn get_position(&self) -> &Position
[src]
fn mut_position(&mut self) -> &mut Position
[src]
fn get_column(&self) -> Option<usize>
[src]
fn set_column(&mut self, col: usize)
[src]
fn offset_column(&mut self, offset: usize)
[src]
fn get_row(&self) -> Option<usize>
[src]
fn set_row(&mut self, row: usize)
[src]
fn offset_row(&mut self, offset: usize)
[src]
fn get_file(&self) -> Option<&str>
[src]
fn set_file(&mut self, file: String)
[src]
fn with_offset_row(self, offset: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_offset_column(self, offset: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_column(self, col: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_row(self, row: usize) -> Self where
Self: Sized,
[src]
Self: Sized,
fn with_file(self, file: String) -> Self where
Self: Sized,
[src]
Self: Sized,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,