BangumiClient

Struct BangumiClient 

Source
pub struct BangumiClient {
    pub base_path: String,
    pub user_agent: Option<String>,
    pub client: Client,
    pub access_token: Option<String>,
}
Expand description

用于与Bangumi API进行交互的客户端

提供了构建请求、发送请求以及处理响应的功能

Fields§

§base_path: String

API的基础路径

§user_agent: Option<String>

可选的User-Agent头,用于标识请求来源

§client: Client

reqwest HTTP客户端,用于发送实际的网络请求

§access_token: Option<String>

可选的访问令牌,用于认证需要授权的API请求

Implementations§

Source§

impl BangumiClient

Source

pub fn new( base_path: String, user_agent: Option<String>, access_token: Option<String>, ) -> Self

创建一个新的BangumiClient实例

§参数
  • base_path: API的基础路径
  • user_agent: 可选的User-Agent头
  • access_token: 可选的访问令牌
§返回

返回一个使用指定参数配置的BangumiClient实例

Source

pub fn request_builder(&self, method: Method, url: &str) -> RequestBuilder

构建HTTP请求

根据提供的HTTP方法和URL创建一个RequestBuilder实例,并设置必要的请求头

§参数
  • method: HTTP请求方法
  • url: 请求的URL
§返回

返回一个配置了User-Agent和Bearer Token(如果有)的RequestBuilder

Source

pub async fn request_send( &self, request_builder: RequestBuilder, ) -> Result<Response>

发送HTTP请求并处理响应

执行RequestBuilder构建的请求,并根据响应状态码进行相应处理

§参数
  • request_builder: 包含请求信息的RequestBuilder
§返回
  • 如果请求成功(状态码200-299),返回包含响应的Result
  • 如果请求失败,将响应体解析为BangumiError并返回错误
Source§

impl BangumiClient

Source

pub async fn search_characters( &self, limit: Option<u32>, offset: Option<u32>, payload: Option<CharacterSearch>, ) -> Result<Paged<Character>>

搜索角色

执行角色搜索请求,支持分页和过滤条件

§参数
  • limit: 每页返回的结果数量
  • offset: 结果偏移量,用于分页
  • payload: 搜索条件,包含关键词和过滤选项
§返回

返回一个包含角色列表的分页结果

Source

pub async fn get_character(&self, character_id: u32) -> Result<Character>

获取角色详情

根据角色ID获取角色的详细信息

§参数
  • character_id: 角色ID
§返回

返回包含角色详细信息的结构体

Source

pub async fn get_character_image( &self, character_id: u32, type: SimpleImageType, ) -> Result<Bytes>

获取角色图片

根据角色ID和图片类型获取角色图片的二进制数据

§参数
  • character_id: 角色ID
  • r#type: 图片类型
§返回

返回图片的二进制数据

Source

pub async fn get_character_subjects( &self, character_id: u32, ) -> Result<Vec<CharacterSubject>>

获取角色参与的条目

根据角色ID获取该角色参与的所有条目信息

§参数
  • character_id: 角色ID
§返回

返回角色参与的条目列表

Source

pub async fn get_character_persons( &self, character_id: u32, ) -> Result<Vec<CharacterPerson>>

获取角色的配音演员或创作者

根据角色ID获取为该角色配音或创作的人员信息

§参数
  • character_id: 角色ID
§返回

返回角色的配音演员或创作者列表

Source

pub async fn collect_character(&self, character_id: u32) -> Result<()>

收藏角色

将指定ID的角色添加到当前用户的收藏列表中

§参数
  • character_id: 角色ID
§返回

操作成功返回Ok(()),失败返回错误

Source

pub async fn uncollect_character(&self, character_id: u32) -> Result<()>

取消收藏角色

从当前用户的收藏列表中移除指定ID的角色

§参数
  • character_id: 角色ID
§返回

操作成功返回Ok(()),失败返回错误

Source§

impl BangumiClient

Source

pub async fn get_collection_subjects( &self, username: &str, subject_type: Option<SubjectType>, type: Option<CollectionType>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<CollectionSubject>>

获取用户的收藏条目列表

支持按条目类型、收藏状态筛选,并提供分页功能

§参数
  • username: 用户名(目标用户的名称)
  • subject_type: 可选,按条目类型筛选(如动画、书籍等)
  • r#type: 可选,按收藏状态筛选(如想看、在看等)
  • limit: 可选,每页返回结果数量
  • offset: 可选,结果偏移量(用于分页)
§返回

返回包含收藏条目的分页结果

Source

pub async fn get_collection_subject( &self, username: &str, subject_id: u32, ) -> Result<CollectionSubject>

获取用户对特定条目的收藏详情

查询指定用户对某个条目的收藏状态、评分、评论等信息

§参数
  • username: 用户名
  • subject_id: 条目ID
§返回

返回该条目对应的收藏详情

Source

pub async fn post_collection_subject( &self, subject_id: u32, payload: Option<CollectionSubjectUpdate>, ) -> Result<()>

创建或更新当前用户对条目的收藏

用于提交或修改用户对指定条目的收藏状态(需认证)

§参数
  • subject_id: 条目ID
  • payload: 收藏更新参数(包含状态、评分、进度等)
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn patch_collection_subject( &self, subject_id: u32, payload: Option<CollectionSubjectUpdate>, ) -> Result<()>

部分更新当前用户对条目的收藏

用于增量修改收藏信息(如仅更新评分或进度,需认证)

§参数
  • subject_id: 条目ID
  • payload: 部分更新参数(可选字段,仅修改指定内容)
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn get_collection_episodes( &self, subject_id: u32, offset: Option<u32>, limit: Option<u32>, episode_type: Option<EpisodeType>, ) -> Result<Paged<CollectionEpisode>>

获取当前用户条目的剧集收藏状态

查询指定条目下各剧集的收藏/观看状态(需认证)

§参数
  • subject_id: 条目ID
  • offset: 可选,结果偏移量(分页用)
  • limit: 可选,每页数量
  • episode_type: 可选,按剧集类型筛选(如正片、SP等)
§返回

返回包含剧集收藏状态的分页结果

Source

pub async fn patch_collection_episodes( &self, subject_id: u32, payload: Option<CollectionEpisodesUpdate>, ) -> Result<()>

批量更新当前用户剧集收藏状态

用于一次性修改多个剧集的收藏状态(需认证)

§参数
  • subject_id: 条目ID
  • payload: 批量更新参数(包含剧集ID列表和目标状态)
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn get_collection_episode( &self, episode_id: u32, ) -> Result<CollectionEpisode>

获取当前用户单个剧集的收藏状态

查询指定剧集的收藏/观看状态(需认证)

§参数
  • episode_id: 剧集ID
§返回

返回该剧集的收藏状态详情

Source

pub async fn put_collection_episode( &self, episode_id: u32, payload: Option<CollectionEpisodeUpdate>, ) -> Result<()>

更新当前用户单个剧集的收藏状态

修改指定剧集的收藏/观看状态(需认证)

§参数
  • episode_id: 剧集ID
  • payload: 剧集状态更新参数
§返回

返回 Ok(())

Source

pub async fn get_collection_characters( &self, username: &str, ) -> Result<Paged<CollectionCharacter>>

获取用户收藏的角色列表

查询指定用户收藏的所有角色(支持分页)

§参数
  • username: 用户名
§返回

返回包含收藏角色的分页结果

Source

pub async fn get_collection_character( &self, username: &str, character_id: u32, ) -> Result<CollectionCharacter>

获取用户对特定角色的收藏详情

查询指定用户对某个角色的收藏信息

§参数
  • username: 用户名
  • character_id: 角色ID
§返回

返回该角色的收藏详情

Source

pub async fn get_collection_persons( &self, username: &str, ) -> Result<Paged<CollectionPerson>>

获取用户收藏的人物列表

查询指定用户收藏的所有人物(如配音演员、导演等,支持分页)

§参数
  • username: 用户名
§返回

返回包含收藏人物的分页结果

Source

pub async fn get_collection_person( &self, username: &str, person_id: u32, ) -> Result<CollectionPerson>

获取用户对特定人物的收藏详情

查询指定用户对某个人物的收藏信息

§参数
  • username: 用户名
  • person_id: 人物ID
§返回

返回该人物的收藏详情

Source§

impl BangumiClient

Source

pub async fn get_episodes( &self, subject_id: u32, type: Option<EpisodeType>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<Episode>>

获取指定条目的剧集列表

支持按剧集类型筛选,并提供分页功能,用于获取某部作品的所有剧集信息

§参数
  • subject_id: 条目ID(必需,指定要查询的作品)
  • r#type: 可选,按剧集类型筛选(如普通剧集、SP、OP等)
  • limit: 可选,每页返回的结果数量
  • offset: 可选,结果偏移量(用于分页,从0开始)
§返回

返回包含剧集列表的分页结果,每页数据为Episode结构体数组

Source

pub async fn get_episode(&self, episode_id: u32) -> Result<Episode>

获取单个剧集的详细信息

根据剧集ID查询某一具体剧集的完整信息,包括名称、时长、播出日期等

§参数
  • episode_id: 剧集ID(必需,指定要查询的具体剧集)
§返回

返回包含该剧集详细信息的Episode结构体

Source§

impl BangumiClient

Source

pub async fn add_index(&self) -> Result<Index>

创建新索引

用于在Bangumi平台创建一个新的索引(通常是主题性的条目集合)

§返回

返回创建成功的索引详情

Source

pub async fn get_index(&self, index_id: u32) -> Result<Index>

获取索引详情

根据索引ID查询指定索引的完整信息,包括标题、描述、统计数据等

§参数
  • index_id: 索引ID(必需,指定要查询的索引)
§返回

返回包含索引详细信息的Index结构体

Source

pub async fn edit_index( &self, index_id: u32, payload: Option<IndexBasicInfo>, ) -> Result<Index>

编辑索引基本信息

更新指定索引的标题和描述等基本信息

§参数
  • index_id: 索引ID(必需,指定要编辑的索引)
  • payload: 可选,包含要更新的标题和描述信息
§返回

返回更新后的索引详情

Source

pub async fn get_index_subjects( &self, index_id: u32, type: Option<SubjectType>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<IndexSubject>>

获取索引中的条目列表

查询指定索引包含的所有条目,支持按条目类型筛选和分页

§参数
  • index_id: 索引ID(必需,指定要查询的索引)
  • r#type: 可选,按条目类型筛选(如动画、书籍等)
  • limit: 可选,每页返回的结果数量
  • offset: 可选,结果偏移量(用于分页)
§返回

返回包含条目列表的分页结果

Source

pub async fn add_index_subject( &self, index_id: u32, payload: Option<IndexSubjectAddInfo>, ) -> Result<()>

向索引添加条目

向指定索引中添加新条目,并可设置排序权重和备注

§参数
  • index_id: 索引ID(必需,指定目标索引)
  • payload: 可选,包含要添加的条目ID、排序权重和备注
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn edit_index_subject( &self, index_id: u32, subject_id: u32, payload: Option<IndexSubjectEditInfo>, ) -> Result<()>

编辑索引中的条目信息

修改指定索引中已有条目的排序权重和备注

§参数
  • index_id: 索引ID(必需,指定目标索引)
  • subject_id: 条目ID(必需,指定要编辑的条目)
  • payload: 可选,包含要更新的排序权重和备注
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn delete_index_subject( &self, index_id: u32, subject_id: u32, ) -> Result<()>

从索引中删除条目

将指定条目从索引中移除

§参数
  • index_id: 索引ID(必需,指定目标索引)
  • subject_id: 条目ID(必需,指定要删除的条目)
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn collect_index(&self, index_id: u32) -> Result<()>

收藏索引

将指定索引添加到当前用户的收藏列表

§参数
  • index_id: 索引ID(必需,指定要收藏的索引)
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn uncollect_index(&self, index_id: u32) -> Result<()>

取消收藏索引

将指定索引从当前用户的收藏列表中移除

§参数
  • index_id: 索引ID(必需,指定要取消收藏的索引)
§返回

操作成功返回空结果,失败返回错误

Source§

impl BangumiClient

Source

pub async fn search_persons( &self, limit: Option<u32>, offset: Option<u32>, payload: Option<PersonSearch>, ) -> Result<Paged<PersonDetail>>

搜索人物

支持按关键词搜索人物,并可通过筛选条件和分页参数控制结果范围

§参数
  • limit: 可选,每页返回的结果数量
  • offset: 可选,结果偏移量(用于分页,从0开始)
  • payload: 可选,搜索条件,包含关键词和职业筛选等信息
§返回

返回包含人物详细信息的分页结果

Source

pub async fn get_person(&self, person_id: u32) -> Result<PersonDetail>

获取人物详细信息

根据人物ID查询完整的人物信息,包括基本资料、职业、统计数据等

§参数
  • person_id: 人物ID(必需,指定要查询的人物)
§返回

返回包含人物完整信息的PersonDetail结构体

Source

pub async fn get_person_image( &self, person_id: u32, type: SimpleImageType, ) -> Result<Bytes>

获取人物图片

根据人物ID和图片类型获取人物图片的二进制数据

§参数
  • person_id: 人物ID(必需,指定目标人物)
  • r#type: 图片类型(如原图、缩略图等,通过SimpleImageType指定)
§返回

返回图片的二进制数据(Bytes类型)

Source

pub async fn get_person_subjects( &self, person_id: u32, ) -> Result<Vec<PersonSubject>>

获取人物参与的条目列表

查询指定人物参与制作的所有作品(条目),包含人物在作品中的职位信息

§参数
  • person_id: 人物ID(必需,指定目标人物)
§返回

返回包含人物参与条目的列表(PersonSubject结构体数组)

Source

pub async fn get_person_characters( &self, person_id: u32, ) -> Result<Vec<PersonCharacter>>

获取人物关联的角色列表

查询指定人物参与配音或创作的角色,包含角色所属作品信息

§参数
  • person_id: 人物ID(必需,指定目标人物)
§返回

返回包含人物关联角色的列表(PersonCharacter结构体数组)

Source

pub async fn collect_person(&self, person_id: u32) -> Result<()>

收藏人物

将指定人物添加到当前用户的收藏列表(需认证,依赖access_token

§参数
  • person_id: 人物ID(必需,指定要收藏的人物)
§返回

操作成功返回空结果,失败返回错误

Source

pub async fn uncollect_person(&self, person_id: u32) -> Result<()>

取消收藏人物

将指定人物从当前用户的收藏列表中移除(需认证,依赖access_token

§参数
  • person_id: 人物ID(必需,指定要取消收藏的人物)
§返回

操作成功返回空结果,失败返回错误

Source§

impl BangumiClient

Source

pub async fn get_revision_persons( &self, person_id: u32, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<RevisionCommon>>

获取指定人物的修订记录列表

查询某个人物的所有编辑修订历史,返回分页的通用修订信息

§参数
  • person_id: 人物ID(必需,指定要查询的人物)
  • limit: 可选,每页返回的修订记录数量
  • offset: 可选,结果偏移量(用于分页,从0开始)
§返回

返回包含通用修订信息的分页结果(Paged<RevisionCommon>

Source

pub async fn get_revision_person( &self, revision_id: u32, ) -> Result<RevisionPerson>

获取单条人物修订记录的详细信息

根据修订记录ID查询某个人物修订的完整数据,包含具体的字段变更内容

§参数
  • revision_id: 修订记录ID(必需,指定要查询的具体修订)
§返回

返回包含人物修订详情的RevisionPerson结构体

Source

pub async fn get_revision_characters( &self, character_id: u32, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<RevisionCommon>>

获取指定角色的修订记录列表

查询某个角色的所有编辑修订历史,返回分页的通用修订信息

§参数
  • character_id: 角色ID(必需,指定要查询的角色)
  • limit: 可选,每页返回的修订记录数量
  • offset: 可选,结果偏移量(用于分页,从0开始)
§返回

返回包含通用修订信息的分页结果(Paged<RevisionCommon>

Source

pub async fn get_revision_character( &self, revision_id: u32, ) -> Result<RevisionCharacter>

获取单条角色修订记录的详细信息

根据修订记录ID查询某个角色修订的完整数据,包含具体的字段变更内容

§参数
  • revision_id: 修订记录ID(必需,指定要查询的具体修订)
§返回

返回包含角色修订详情的RevisionCharacter结构体

Source

pub async fn get_revision_subjects( &self, subject_id: u32, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<RevisionCommon>>

获取指定条目的修订记录列表

查询某个条目(作品)的所有编辑修订历史,返回分页的通用修订信息

§参数
  • subject_id: 条目ID(必需,指定要查询的作品)
  • limit: 可选,每页返回的修订记录数量
  • offset: 可选,结果偏移量(用于分页,从0开始)
§返回

返回包含通用修订信息的分页结果(Paged<RevisionCommon>

Source

pub async fn get_revision_subject( &self, revision_id: u32, ) -> Result<RevisionSubject>

获取单条条目修订记录的详细信息

根据修订记录ID查询某个条目修订的完整数据,包含具体的字段变更内容

§参数
  • revision_id: 修订记录ID(必需,指定要查询的具体修订)
§返回

返回包含条目修订详情的RevisionSubject结构体

Source

pub async fn get_revision_episodes( &self, episode_id: u32, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<RevisionCommon>>

获取指定剧集的修订记录列表

查询某个剧集的所有编辑修订历史,返回分页的通用修订信息

§参数
  • episode_id: 剧集ID(必需,指定要查询的剧集)
  • limit: 可选,每页返回的修订记录数量
  • offset: 可选,结果偏移量(用于分页,从0开始)
§返回

返回包含通用修订信息的分页结果(Paged<RevisionCommon>

Source

pub async fn get_revision_episode( &self, revision_id: u32, ) -> Result<RevisionEpisode>

获取单条剧集修订记录的详细信息

根据修订记录ID查询某个剧集修订的完整数据,包含具体的字段变更内容

§参数
  • revision_id: 修订记录ID(必需,指定要查询的具体修订)
§返回

返回包含剧集修订详情的RevisionEpisode结构体

Source§

impl BangumiClient

Source

pub async fn get_calendar(&self) -> Result<Vec<DailyCalendarItem>>

获取每日番剧日历

获取按星期分类的番剧条目列表,包含每日更新的番剧信息

§返回

成功返回每日日历条目列表,失败返回错误

Source

pub async fn search_subjects( &self, limit: Option<u32>, offset: Option<u32>, payload: Option<SubjectSearch>, ) -> Result<Paged<Subject>>

搜索番剧条目

根据搜索条件查询番剧条目,支持分页获取结果

§参数
  • limit: 结果数量上限(可选,限制返回的条目数量)
  • offset: 结果偏移量(可选,用于分页,指定从第几条结果开始返回)
  • payload: 搜索条件(可选,包含关键词、排序方式、过滤条件等)
§返回

成功返回分页的番剧条目列表,失败返回错误

Source

pub async fn get_subjects( &self, type: SubjectType, cat: Option<SubjectCategory>, series: Option<bool>, platform: Option<&str>, sort: Option<SubjectBrowseSort>, year: Option<u32>, month: Option<u32>, limit: Option<u32>, offset: Option<u32>, ) -> Result<Paged<Subject>>

获取番剧条目列表

根据筛选条件获取番剧条目列表,支持按类型、分类、时间等条件筛选

§参数
  • r#type: 条目类型(必需,指定要获取的条目类型,如动画、书籍等)
  • cat: 子类别(可选,进一步筛选条目子类别,如动画中的TV、电影等)
  • series: 是否为系列作品(可选,筛选系列作品或独立作品)
  • platform: 平台(可选,筛选特定平台的条目)
  • sort: 排序方式(可选,指定结果排序规则,如按日期、排名排序)
  • year: 年份(可选,筛选特定年份的条目)
  • month: 月份(可选,筛选特定月份的条目)
  • limit: 结果数量上限(可选,限制返回的条目数量)
  • offset: 结果偏移量(可选,用于分页,指定从第几条结果开始返回)
§返回

成功返回分页的番剧条目列表,失败返回错误

Source

pub async fn get_subject(&self, subject_id: u32) -> Result<Subject>

获取单个番剧条目详情

根据条目ID获取指定番剧条目的详细信息,包括名称、简介、评分等

§参数
  • subject_id: 条目ID(必需,指定要获取详情的番剧条目)
§返回

成功返回番剧条目详情,失败返回错误

Source

pub async fn get_subject_image( &self, subject_id: u32, type: ImageType, ) -> Result<Bytes>

获取番剧条目图片

根据条目ID和图片类型获取指定番剧条目的图片数据

§参数
  • subject_id: 条目ID(必需,指定要获取图片的番剧条目)
  • r#type: 图片类型(必需,指定要获取的图片类型)
§返回

成功返回图片二进制数据,失败返回错误

Source

pub async fn get_subject_persons( &self, subject_id: u32, ) -> Result<Vec<SubjectPerson>>

获取番剧条目相关人物

根据条目ID获取与该番剧条目相关的人物信息,如制作人员、声优等

§参数
  • subject_id: 条目ID(必需,指定要获取相关人物的番剧条目)
§返回

成功返回相关人物列表,失败返回错误

Source

pub async fn get_subject_characters( &self, subject_id: u32, ) -> Result<Vec<SubjectCharacter>>

获取番剧条目相关角色

根据条目ID获取与该番剧条目相关的角色信息,包括角色名称、简介及配音演员等

§参数
  • subject_id: 条目ID(必需,指定要获取相关角色的番剧条目)
§返回

成功返回相关角色列表,失败返回错误

Source

pub async fn get_subject_subjects( &self, subject_id: u32, ) -> Result<Vec<SubjectSubject>>

获取番剧条目相关其他条目

根据条目ID获取与该番剧条目相关的其他番剧条目,如系列作品、衍生作品等

§参数
  • subject_id: 条目ID(必需,指定要获取相关条目的番剧条目)
§返回

成功返回相关条目列表,失败返回错误

Source§

impl BangumiClient

Source

pub async fn get_user(&self, username: &str) -> Result<UserPublic>

Source

pub async fn get_user_avatar( &self, username: &str, type: AvatarType, ) -> Result<Bytes>

Source

pub async fn get_me(&self) -> Result<User>

Trait Implementations§

Source§

impl Default for BangumiClient

为BangumiClient提供默认实现

默认配置:

  • 使用“https://api.bgm.tv“作为基础路径
  • 设置特定格式的User-Agent
  • 初始化一个基本的reqwest客户端
  • 不包含访问令牌
Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,