pub struct SinkholeRoles<'a> { /* private fields */ }Expand description
Sinkhole rule routes, from Client::sinkhole_roles (Core calls rules “roles”).
Only the list’s owner (or an Admin) may read or change rules, also for a shared list.
To address rules by pattern instead of uuid, see
ops::select_sinkhole_roles.
Implementations§
Source§impl<'a> SinkholeRoles<'a>
impl<'a> SinkholeRoles<'a>
Sourcepub async fn get(&self, uuid: Uuid) -> Result<SinkholeRole>
pub async fn get(&self, uuid: Uuid) -> Result<SinkholeRole>
One rule.
GET /api/v1/sinkhole-roles/:uuid
§Errors
ErrorCode::NotFoundif there is no such rule.ErrorCode::Forbiddenif its list belongs to another user.
Sourcepub async fn create(&self, role: &NewSinkholeRole) -> Result<SinkholeRole>
pub async fn create(&self, role: &NewSinkholeRole) -> Result<SinkholeRole>
Adds a rule to a list; Relay applies it to every linked client. Returns the rule with the pattern as stored (names lowercased, no trailing dot).
POST /api/v1/sinkhole-roles
§Errors
ErrorCode::Validationif the pattern does not fit the type.ErrorCode::NotFoundif the list does not exist.ErrorCode::Forbiddenif it belongs to another user.
Sourcepub async fn update(
&self,
uuid: Uuid,
patch: &SinkholeRolePatch,
) -> Result<SinkholeRole>
pub async fn update( &self, uuid: Uuid, patch: &SinkholeRolePatch, ) -> Result<SinkholeRole>
Changes a rule’s type and/or pattern; fields left None stay as they are.
PATCH /api/v1/sinkhole-roles/:uuid
§Errors
ErrorCode::NotFoundif there is no such rule.ErrorCode::Forbiddenif its list belongs to another user.ErrorCode::Validationif the result would not fit together (e.g. typeWildcardwith a pattern without*.).
Sourcepub async fn delete(&self, uuid: Uuid) -> Result<()>
pub async fn delete(&self, uuid: Uuid) -> Result<()>
Removes a rule from its list.
DELETE /api/v1/sinkhole-roles/:uuid
§Errors
ErrorCode::NotFoundif there is no such rule.ErrorCode::Forbiddenif its list belongs to another user.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SinkholeRoles<'a>
impl<'a> !UnwindSafe for SinkholeRoles<'a>
impl<'a> Freeze for SinkholeRoles<'a>
impl<'a> Send for SinkholeRoles<'a>
impl<'a> Sync for SinkholeRoles<'a>
impl<'a> Unpin for SinkholeRoles<'a>
impl<'a> UnsafeUnpin for SinkholeRoles<'a>
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