#[non_exhaustive]pub enum DraftError {
Io(Error),
Json(Error),
FmWrite(FmWriteError),
Toml {
source: Error,
file: PathBuf,
},
PostTooLong {
chars: usize,
max: usize,
file: PathBuf,
},
BlogPostListEmpty,
}Expand description
Errors that can occur during LinkedIn draft generation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(Error)
I/O error reading or writing files.
Json(Error)
JSON serialization error writing the .linkedin file.
FmWrite(FmWriteError)
Frontmatter write-back error.
Toml
TOML parse error reading a blog post’s frontmatter.
PostTooLong
Post text exceeds the LinkedIn character limit.
The character count includes the post text and the appended link (separated by a single space).
Fields
§
max: usizeConfigured maximum (LINKEDIN_POST_MAX_CHARS).
BlogPostListEmpty
No blog posts found matching the filter criteria.
Trait Implementations§
Source§impl Debug for DraftError
impl Debug for DraftError
Source§impl Display for DraftError
impl Display for DraftError
Source§impl Error for DraftError
impl Error for DraftError
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 From<Error> for DraftError
impl From<Error> for DraftError
Auto Trait Implementations§
impl !RefUnwindSafe for DraftError
impl !UnwindSafe for DraftError
impl Forget for DraftError
impl Freeze for DraftError
impl Move for DraftError
impl Send for DraftError
impl Sync for DraftError
impl Unpin for DraftError
impl UnsafeUnpin for DraftError
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