Struct torrust_index_backend::services::user::BanService
source · pub struct BanService { /* private fields */ }
Implementations§
source§impl BanService
impl BanService
pub fn new( user_repository: Arc<DbUserRepository>, user_profile_repository: Arc<DbUserProfileRepository>, banned_user_list: Arc<DbBannedUserList> ) -> Self
sourcepub async fn ban_user(
&self,
username_to_be_banned: &str,
user_id: &UserId
) -> Result<(), ServiceError>
pub async fn ban_user( &self, username_to_be_banned: &str, user_id: &UserId ) -> Result<(), ServiceError>
Ban a user from the Index.
Errors
This function will return a:
ServiceError::InternalServerError
if unable get user from the request.- An error if unable to get user profile from supplied username.
- An error if unable to set the ban of the user in the database.
Auto Trait Implementations§
impl !RefUnwindSafe for BanService
impl Send for BanService
impl Sync for BanService
impl Unpin for BanService
impl !UnwindSafe for BanService
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