pub enum AssetRef {
Post {
post_id: i32,
title: String,
slug: String,
status: AssetRefPostStatus,
},
Comment {
comment_id: i64,
author_name: String,
post_id: i32,
post_title: String,
post_slug: String,
post_status: AssetRefPostStatus,
},
UserAvatar {
user_id: i32,
label: String,
},
FriendAvatar {
friend_id: i32,
name: String,
},
}Expand description
引用该素材的一处来源(素材详情浮层/删除拦截时列出)。
serde tagged enum,WASM 前端按 kind 判别分组渲染。四个来源与
api::assets::ASSET_REF_CLAUSE 一一对应:
文章引用来自 asset_refs 表(正文 HTML + 封面,含草稿与回收站文章);
评论/头像引用在查询时按素材路径直接匹配(存活评论、用户头像、友链头像)。
Variants§
Post
文章引用(asset_refs 表)。
Comment
存活评论引用(content_html 子串匹配;评论无深链,展示作者 + 所属文章)。
UserAvatar
用户头像引用(users.avatar_url)。label = display_name 回退 username。
FriendAvatar
友链头像引用(friend_links.avatar_url)。
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AssetRef
impl<'de> Deserialize<'de> for AssetRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for AssetRef
Auto Trait Implementations§
impl Freeze for AssetRef
impl RefUnwindSafe for AssetRef
impl Send for AssetRef
impl Sync for AssetRef
impl Unpin for AssetRef
impl UnsafeUnpin for AssetRef
impl UnwindSafe for AssetRef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
§impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
§fn transport_to_bytes(&self) -> Vec<u8> ⓘ
fn transport_to_bytes(&self) -> Vec<u8> ⓘ
Serialize the type to a byte vector for transport
§fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
Deserialize the type from a byte slice