pub enum SubXError {
Io(Error),
Config {
message: String,
},
SubtitleFormat {
format: String,
message: String,
},
AiService(String),
AudioProcessing {
message: String,
},
FileMatching {
message: String,
},
FileAlreadyExists(String),
FileNotFound(String),
InvalidFileName(String),
FileOperationFailed(String),
CommandExecution(String),
Other(Error),
}Expand description
SubX 應用程式的主要錯誤類型
Variants§
Io(Error)
IO 相關錯誤
Config
配置錯誤
SubtitleFormat
字幕格式錯誤
AiService(String)
AI 服務錯誤
AudioProcessing
音訊處理錯誤
FileMatching
文件匹配錯誤
FileAlreadyExists(String)
檔案已存在錯誤
FileNotFound(String)
檔案不存在錯誤
InvalidFileName(String)
無效的檔案名稱錯誤
FileOperationFailed(String)
檔案操作失敗錯誤
CommandExecution(String)
命令執行錯誤
Other(Error)
一般錯誤
Implementations§
Source§impl SubXError
impl SubXError
Sourcepub fn subtitle_format<S1, S2>(format: S1, message: S2) -> Self
pub fn subtitle_format<S1, S2>(format: S1, message: S2) -> Self
建立字幕格式錯誤
Sourcepub fn audio_processing<S: Into<String>>(message: S) -> Self
pub fn audio_processing<S: Into<String>>(message: S) -> Self
建立音訊處理錯誤
Sourcepub fn ai_service<S: Into<String>>(message: S) -> Self
pub fn ai_service<S: Into<String>>(message: S) -> Self
建立 AI 服務錯誤
Sourcepub fn file_matching<S: Into<String>>(message: S) -> Self
pub fn file_matching<S: Into<String>>(message: S) -> Self
建立文件匹配錯誤
Sourcepub fn parallel_processing(msg: String) -> Self
pub fn parallel_processing(msg: String) -> Self
建立平行處理錯誤
Sourcepub fn task_execution_failed(task_id: String, reason: String) -> Self
pub fn task_execution_failed(task_id: String, reason: String) -> Self
建立任務執行失敗錯誤
Sourcepub fn worker_pool_exhausted() -> Self
pub fn worker_pool_exhausted() -> Self
建立工作者池耗盡錯誤
Sourcepub fn task_timeout(task_id: String, duration: Duration) -> Self
pub fn task_timeout(task_id: String, duration: Duration) -> Self
建立任務超時錯誤
Sourcepub fn dialogue_detection_failed<S: Into<String>>(msg: S) -> Self
pub fn dialogue_detection_failed<S: Into<String>>(msg: S) -> Self
建立對話檢測失敗錯誤
Sourcepub fn invalid_audio_format<S: Into<String>>(format: S) -> Self
pub fn invalid_audio_format<S: Into<String>>(format: S) -> Self
建立無效音訊格式錯誤
Sourcepub fn dialogue_segment_invalid<S: Into<String>>(reason: S) -> Self
pub fn dialogue_segment_invalid<S: Into<String>>(reason: S) -> Self
建立無效對話片段錯誤
Sourcepub fn user_friendly_message(&self) -> String
pub fn user_friendly_message(&self) -> String
取得用戶友善的錯誤訊息
Trait Implementations§
Source§impl Error for SubXError
impl Error for SubXError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<AudioError> for SubXError
impl From<AudioError> for SubXError
Source§fn from(error: AudioError) -> Self
fn from(error: AudioError) -> Self
Converts to this type from the input type.
Source§impl From<SpectrumError> for SubXError
impl From<SpectrumError> for SubXError
Source§fn from(error: SpectrumError) -> Self
fn from(error: SpectrumError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SubXError
impl !RefUnwindSafe for SubXError
impl Send for SubXError
impl Sync for SubXError
impl Unpin for SubXError
impl !UnwindSafe for SubXError
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> 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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.