pub struct EditorPageRepository { /* private fields */ }Expand description
编辑器页面仓储
Implementations§
Source§impl EditorPageRepository
impl EditorPageRepository
Sourcepub async fn list_by_episode_with<C: ConnectionTrait>(
db: &C,
episode_id: i32,
) -> ApiResult<Vec<Model>>
pub async fn list_by_episode_with<C: ConnectionTrait>( db: &C, episode_id: i32, ) -> ApiResult<Vec<Model>>
使用指定连接查询某话数全部页面,供事务内复用。
Sourcepub async fn count_by_episode(&self, episode_id: i32) -> ApiResult<u64>
pub async fn count_by_episode(&self, episode_id: i32) -> ApiResult<u64>
统计某话数页面数
Sourcepub async fn delete_by_episode(&self, episode_id: i32) -> ApiResult<Vec<i64>>
pub async fn delete_by_episode(&self, episode_id: i32) -> ApiResult<Vec<i64>>
删除某话数全部页面,返回被删页面的 ID 列表(供级联删除标记)
Sourcepub async fn delete_by_episode_with<C: ConnectionTrait>(
db: &C,
episode_id: i32,
) -> ApiResult<Vec<i64>>
pub async fn delete_by_episode_with<C: ConnectionTrait>( db: &C, episode_id: i32, ) -> ApiResult<Vec<i64>>
使用指定连接删除某话数全部页面,供事务内复用。
Sourcepub async fn insert_pages(
&self,
episode_id: i32,
pages: Vec<NewEditorPage>,
) -> ApiResult<Vec<Model>>
pub async fn insert_pages( &self, episode_id: i32, pages: Vec<NewEditorPage>, ) -> ApiResult<Vec<Model>>
批量插入页面记录
Sourcepub async fn insert_pages_with<C: ConnectionTrait>(
db: &C,
episode_id: i32,
pages: Vec<NewEditorPage>,
) -> ApiResult<Vec<Model>>
pub async fn insert_pages_with<C: ConnectionTrait>( db: &C, episode_id: i32, pages: Vec<NewEditorPage>, ) -> ApiResult<Vec<Model>>
使用指定连接批量插入页面,供事务内原子重建复用。
Auto Trait Implementations§
impl Freeze for EditorPageRepository
impl !RefUnwindSafe for EditorPageRepository
impl Send for EditorPageRepository
impl Sync for EditorPageRepository
impl Unpin for EditorPageRepository
impl UnsafeUnpin for EditorPageRepository
impl !UnwindSafe for EditorPageRepository
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request