pub struct SiteSettings {
pub github_url: String,
}Expand description
站点公开配置(前台展示用,所有访客可见)。
目前仅包含页脚 GitHub 链接;后续可在此结构上扩展更多公开站点配置。
Fields§
§github_url: StringGitHub 仓库链接,空字符串表示不展示页脚图标。
Implementations§
Source§impl SiteSettings
impl SiteSettings
Sourcepub fn normalize_github_url(url: &str) -> String
pub fn normalize_github_url(url: &str) -> String
规范化 GitHub 链接:trim、截断、补全 scheme。
- 空串(trim 后)→ 返回空串,表示未配置。
- 已带
http:///https://→ 原样保留(截断到上限)。 - 否则在前面补
https://;这同时把javascript:/data:等危险 scheme 变成无效 URL(https://javascript:...),杜绝通过页脚href注入脚本。
Trait Implementations§
Source§impl Clone for SiteSettings
impl Clone for SiteSettings
Source§fn clone(&self) -> SiteSettings
fn clone(&self) -> SiteSettings
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 SiteSettings
impl Debug for SiteSettings
Source§impl Default for SiteSettings
impl Default for SiteSettings
Source§impl<'de> Deserialize<'de> for SiteSettings
impl<'de> Deserialize<'de> for SiteSettings
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
Source§impl PartialEq for SiteSettings
impl PartialEq for SiteSettings
Source§impl Serialize for SiteSettings
impl Serialize for SiteSettings
impl StructuralPartialEq for SiteSettings
Auto Trait Implementations§
impl Freeze for SiteSettings
impl RefUnwindSafe for SiteSettings
impl Send for SiteSettings
impl Sync for SiteSettings
impl Unpin for SiteSettings
impl UnsafeUnpin for SiteSettings
impl UnwindSafe for SiteSettings
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