pub struct Post { /* private fields */ }Expand description
Manages publishing staged .linkedin draft files to LinkedIn.
Implementations§
Source§impl Post
impl Post
Sourcepub fn new(access_token: &str, author_urn: &str) -> Self
pub fn new(access_token: &str, author_urn: &str) -> Self
Create a new Post manager with the given credentials.
Sourcepub fn with_api_version(self, version: impl Into<String>) -> Self
pub fn with_api_version(self, version: impl Into<String>) -> Self
Override the LinkedIn API version sent in the LinkedIn-Version header.
Sourcepub fn load<P>(&mut self, store_dir: P) -> Result<&mut Self, PostError>
pub fn load<P>(&mut self, store_dir: P) -> Result<&mut Self, PostError>
Load all .linkedin files from store_dir.
Sourcepub async fn post_to_linkedin(&mut self) -> Result<&mut Self, PostError>
pub async fn post_to_linkedin(&mut self) -> Result<&mut Self, PostError>
Publish all loaded posts to LinkedIn.
In test mode (TESTING=true env var) posts are not actually sent.
Sourcepub fn delete_posted_posts(&mut self) -> Result<&mut Self, PostError>
pub fn delete_posted_posts(&mut self) -> Result<&mut Self, PostError>
Delete .linkedin files for all successfully posted content and write
[linkedin].published = <today> into the source markdown file.
Sourcepub fn count_deleted(&self) -> usize
pub fn count_deleted(&self) -> usize
Number of posts successfully deleted (published + cleaned up).
Auto Trait Implementations§
impl Forget for Post
impl Freeze for Post
impl Move for Post
impl RefUnwindSafe for Post
impl Send for Post
impl Sync for Post
impl Unpin for Post
impl UnsafeUnpin for Post
impl UnwindSafe for Post
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