pub struct ShareLink {
pub id: String,
pub entity_id: String,
pub disk_type: DiskType,
pub file_path: String,
pub file_name: String,
pub url: String,
pub created_at: i64,
pub expires_at: Option<i64>,
pub password_protected: bool,
pub access_count: u64,
pub max_accesses: Option<u64>,
pub active: bool,
}Expand description
Share link for a file with optional expiry and password protection.
Fields§
§id: StringUnique share link ID.
entity_id: StringEntity ID that owns the file.
disk_type: DiskTypeDisk type containing the file.
file_path: StringPath to the shared file.
file_name: StringFile name for display.
url: StringShareable URL.
created_at: i64Unix timestamp (ms) when link was created.
expires_at: Option<i64>Unix timestamp (ms) when link expires (None = never).
password_protected: boolWhether the link is password protected.
access_count: u64Number of times the link has been accessed.
max_accesses: Option<u64>Maximum number of accesses allowed (None = unlimited).
active: boolWhether the link is currently active.
Implementations§
Sourcepub fn is_expired(&self, now_ms: i64) -> bool
pub fn is_expired(&self, now_ms: i64) -> bool
Returns true if the link has expired.
Sourcepub fn is_access_limit_reached(&self) -> bool
pub fn is_access_limit_reached(&self) -> bool
Returns true if the link has reached max accesses.
Sourcepub fn remaining_accesses(&self) -> Option<u64>
pub fn remaining_accesses(&self) -> Option<u64>
Returns remaining accesses (None if unlimited).
Trait Implementations§
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
Auto Trait Implementations§
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