pub struct SecurityErrorBuilder;Expand description
安全错误构建器 - 专门用于安全场景的便利函数
Implementations§
Source§impl SecurityErrorBuilder
impl SecurityErrorBuilder
Sourcepub fn device_not_found(device_id: impl Into<String>) -> SecurityError
pub fn device_not_found(device_id: impl Into<String>) -> SecurityError
设备未找到
Sourcepub fn device_connection_failed(
device_id: impl Into<String>,
reason: impl Into<String>,
) -> SecurityError
pub fn device_connection_failed( device_id: impl Into<String>, reason: impl Into<String>, ) -> SecurityError
设备连接失败
设备临时不可用(可重试)
Sourcepub fn access_denied(
resource: impl Into<String>,
reason: impl Into<String>,
) -> SecurityError
pub fn access_denied( resource: impl Into<String>, reason: impl Into<String>, ) -> SecurityError
访问控制被拒绝
Sourcepub fn insufficient_permissions(
required_permissions: &[impl AsRef<str>],
current_permissions: &[impl AsRef<str>],
) -> SecurityError
pub fn insufficient_permissions( required_permissions: &[impl AsRef<str>], current_permissions: &[impl AsRef<str>], ) -> SecurityError
权限范围不足
Sourcepub fn face_recognition_failed(
reason: impl Into<String>,
image_id: Option<impl Into<String>>,
) -> SecurityError
pub fn face_recognition_failed( reason: impl Into<String>, image_id: Option<impl Into<String>>, ) -> SecurityError
人脸识别失败
人脸识别服务不可用
Sourcepub fn visitor_permission_expired(
visitor_id: impl Into<String>,
visit_type: impl Into<String>,
) -> SecurityError
pub fn visitor_permission_expired( visitor_id: impl Into<String>, visit_type: impl Into<String>, ) -> SecurityError
访客权限过期
Sourcepub fn visitor_authentication_failed(
visitor_id: impl Into<String>,
reason: impl Into<String>,
) -> SecurityError
pub fn visitor_authentication_failed( visitor_id: impl Into<String>, reason: impl Into<String>, ) -> SecurityError
访客身份验证失败
Sourcepub fn compliance_check_failed(
compliance_type: impl Into<String>,
reason: impl Into<String>,
resource_id: Option<impl Into<String>>,
) -> SecurityError
pub fn compliance_check_failed( compliance_type: impl Into<String>, reason: impl Into<String>, resource_id: Option<impl Into<String>>, ) -> SecurityError
合规检查失败
Sourcepub fn audit_log_failed(
log_type: impl Into<String>,
reason: impl Into<String>,
) -> SecurityError
pub fn audit_log_failed( log_type: impl Into<String>, reason: impl Into<String>, ) -> SecurityError
审计日志写入失败
Sourcepub fn security_config_invalid(
config_key: impl Into<String>,
reason: impl Into<String>,
) -> SecurityError
pub fn security_config_invalid( config_key: impl Into<String>, reason: impl Into<String>, ) -> SecurityError
配置错误
Sourcepub fn time_sync_failed(
service: impl Into<String>,
deviation_ms: i64,
) -> SecurityError
pub fn time_sync_failed( service: impl Into<String>, deviation_ms: i64, ) -> SecurityError
时间同步错误
Sourcepub fn crypto_operation_failed(
operation: impl Into<String>,
algorithm: impl Into<String>,
reason: impl Into<String>,
) -> SecurityError
pub fn crypto_operation_failed( operation: impl Into<String>, algorithm: impl Into<String>, reason: impl Into<String>, ) -> SecurityError
加密操作失败
Sourcepub fn security_check_timeout(
check_type: impl Into<String>,
timeout_duration: Duration,
) -> SecurityError
pub fn security_check_timeout( check_type: impl Into<String>, timeout_duration: Duration, ) -> SecurityError
安全检查超时
Sourcepub fn security_api_rate_limited(
endpoint: impl Into<String>,
limit: u32,
window_seconds: u64,
) -> SecurityError
pub fn security_api_rate_limited( endpoint: impl Into<String>, limit: u32, window_seconds: u64, ) -> SecurityError
安全API调用限流
Trait Implementations§
Source§impl Clone for SecurityErrorBuilder
impl Clone for SecurityErrorBuilder
Source§fn clone(&self) -> SecurityErrorBuilder
fn clone(&self) -> SecurityErrorBuilder
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 moreSource§impl Debug for SecurityErrorBuilder
impl Debug for SecurityErrorBuilder
impl Copy for SecurityErrorBuilder
Auto Trait Implementations§
impl Freeze for SecurityErrorBuilder
impl RefUnwindSafe for SecurityErrorBuilder
impl Send for SecurityErrorBuilder
impl Sync for SecurityErrorBuilder
impl Unpin for SecurityErrorBuilder
impl UnsafeUnpin for SecurityErrorBuilder
impl UnwindSafe for SecurityErrorBuilder
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