pub struct DataManager(pub DataManager<Config>);Tuple Fields§
§0: DataManager<Config>Implementations§
Source§impl DataManager
impl DataManager
Sourcepub(crate) fn get_entry_from_row(x: &PostgresRow) -> Entry
pub(crate) fn get_entry_from_row(x: &PostgresRow) -> Entry
Get an Entry from an SQL row.
pub async fn get_entry_by_id(&self, selector: usize) -> Result<Entry>
pub async fn get_entry_by_slug(&self, selector: &str) -> Result<Entry>
fn hash_passwords(metadata: &mut EntryMetadata) -> (bool, String)
Sourcepub async fn create_entry(&self, data: Entry) -> Result<Entry>
pub async fn create_entry(&self, data: Entry) -> Result<Entry>
Sourcepub async fn update_entry(
&self,
id: usize,
edit_code: String,
new_slug: String,
new_content: String,
new_metadata: String,
new_edit_code: String,
new_modify_code: String,
by_ip: String,
) -> Result<String>
pub async fn update_entry( &self, id: usize, edit_code: String, new_slug: String, new_content: String, new_metadata: String, new_edit_code: String, new_modify_code: String, by_ip: String, ) -> Result<String>
Update an existing entry.
Sourcepub async fn delete_entry(&self, id: usize, edit_code: String) -> Result<()>
pub async fn delete_entry(&self, id: usize, edit_code: String) -> Result<()>
Delete an existing entry.
Sourcepub async fn cache_clear_entry(&self, entry: &Entry) -> bool
pub async fn cache_clear_entry(&self, entry: &Entry) -> bool
Remove an Entry from the cache.
pub async fn incr_entry_views(&self, id: usize) -> Result<()>
pub async fn decr_entry_views(&self, id: usize) -> Result<()>
Trait Implementations§
Source§impl Clone for DataManager
impl Clone for DataManager
Source§fn clone(&self) -> DataManager
fn clone(&self) -> DataManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DataManager
impl !RefUnwindSafe for DataManager
impl Send for DataManager
impl Sync for DataManager
impl Unpin for DataManager
impl !UnwindSafe for DataManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more