Struct build_data::BuildData [−][src]
Build data parser and holder. Example in module docs.
Fields
git_branch: Option<String>git_commit: Option<String>git_dirty: Option<bool>hostname: Option<String>rustc_version: Option<String>time: Stringtime_seconds: u64Implementations
impl BuildData[src]
pub fn new(contents: impl AsRef<str>) -> Result<Self, &'static str>[src]
Parses build-data.txt written by
build_data_writer::write.
See module docs for example and expected file format.
Ignores malformed fields.
Treats empty fields as missing.
Trims whitespace from field names and values.
If a field appears multiple times, uses the last value.
Errors
Returns an error when:
contentsis emptycontentsis missingTIMEorTIME_SECONDSfieldscontentshas aTIME_SECONDSfield that is not all decimal digits convertible to a u64
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BuildData
impl Send for BuildData
impl Sync for BuildData
impl Unpin for BuildData
impl UnwindSafe for BuildData
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,
pub 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> 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.
pub 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>,