pub struct InvalidFieldValue<T> { /* private fields */ }Expand description
A field value that is invalid according to the spec, with the value as stored in the file.
T is the type of the stored value: String for fields in the GSI block, u8 for single
byte fields and Time for time codes in the TTI blocks.
§Example
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
let dfc = stl.gsi.disk_format_code();
for tti in &stl.ttis {
// Use the time code as stored, even if it is outside the ranges in the spec
let tci = tti.time_code_in(dfc).unwrap_or_else(|err| {
eprintln!("{err}");
err.into_value()
});
assert_eq!(10, tci.hours);
}Implementations§
Source§impl<T> InvalidFieldValue<T>
impl<T> InvalidFieldValue<T>
Trait Implementations§
Source§impl<T: Clone> Clone for InvalidFieldValue<T>
impl<T: Clone> Clone for InvalidFieldValue<T>
Source§impl<T: Debug> Debug for InvalidFieldValue<T>
impl<T: Debug> Debug for InvalidFieldValue<T>
Source§impl<T> Display for InvalidFieldValue<T>
impl<T> Display for InvalidFieldValue<T>
impl<T: Eq> Eq for InvalidFieldValue<T>
Source§impl<T> Error for InvalidFieldValue<T>
impl<T> Error for InvalidFieldValue<T>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl<T> From<InvalidFieldValue<T>> for ParseError
Keeps the message but not the value, which can be of different types
impl<T> From<InvalidFieldValue<T>> for ParseError
Keeps the message but not the value, which can be of different types
Source§fn from(err: InvalidFieldValue<T>) -> Self
fn from(err: InvalidFieldValue<T>) -> Self
Converts to this type from the input type.
Source§impl<T: PartialEq> PartialEq for InvalidFieldValue<T>
impl<T: PartialEq> PartialEq for InvalidFieldValue<T>
impl<T: PartialEq> StructuralPartialEq for InvalidFieldValue<T>
Auto Trait Implementations§
impl<T> Freeze for InvalidFieldValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for InvalidFieldValue<T>where
T: RefUnwindSafe,
impl<T> Send for InvalidFieldValue<T>where
T: Send,
impl<T> Sync for InvalidFieldValue<T>where
T: Sync,
impl<T> Unpin for InvalidFieldValue<T>where
T: Unpin,
impl<T> UnsafeUnpin for InvalidFieldValue<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for InvalidFieldValue<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more