pub struct Attachment { /* private fields */ }Expand description
Represents metadata for a attachment in a Zulip message.
Implementations§
Source§impl Attachment
impl Attachment
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new Attachment.
Source§impl Attachment
impl Attachment
Sourcepub const fn id(&self) -> Option<u64>
pub const fn id(&self) -> Option<u64>
Gets the Attachment id.
The unique ID for the attachment.
Sourcepub fn set_id(&mut self, val: u64)
pub fn set_id(&mut self, val: u64)
Sets the Attachment id.
The unique ID for the attachment.
Sourcepub fn unset_id(&mut self) -> Option<u64>
pub fn unset_id(&mut self) -> Option<u64>
Unsets the Attachment id.
The unique ID for the attachment.
Sourcepub fn with_id(self, val: u64) -> Self
pub fn with_id(self, val: u64) -> Self
Builder function that sets the Attachment id.
The unique ID for the attachment.
Sourcepub const fn size(&self) -> Option<u64>
pub const fn size(&self) -> Option<u64>
Gets the Attachment size.
Size of the file in bytes.
Sourcepub fn set_size(&mut self, val: u64)
pub fn set_size(&mut self, val: u64)
Sets the Attachment size.
Size of the file in bytes.
Sourcepub fn unset_size(&mut self) -> Option<u64>
pub fn unset_size(&mut self) -> Option<u64>
Unsets the Attachment size.
Size of the file in bytes.
Sourcepub fn with_size(self, val: u64) -> Self
pub fn with_size(self, val: u64) -> Self
Builder function that sets the Attachment size.
Size of the file in bytes.
Sourcepub const fn create_time(&self) -> Option<u64>
pub const fn create_time(&self) -> Option<u64>
Gets the Attachment create_time.
Time when the attachment was uploaded as a UNIX timestamp
multiplied by 1000 (matching the format of getTime() in JavaScript).
Changes: Changed in Zulip 3.0 (feature level 22). This field was
previously a floating point number.
Sourcepub fn set_create_time(&mut self, val: u64)
pub fn set_create_time(&mut self, val: u64)
Sets the Attachment create_time.
Time when the attachment was uploaded as a UNIX timestamp
multiplied by 1000 (matching the format of getTime() in JavaScript).
Changes: Changed in Zulip 3.0 (feature level 22). This field was
previously a floating point number.
Sourcepub fn unset_create_time(&mut self) -> Option<u64>
pub fn unset_create_time(&mut self) -> Option<u64>
Unsets the Attachment create_time.
Time when the attachment was uploaded as a UNIX timestamp
multiplied by 1000 (matching the format of getTime() in JavaScript).
Changes: Changed in Zulip 3.0 (feature level 22). This field was
previously a floating point number.
Sourcepub fn with_create_time(self, val: u64) -> Self
pub fn with_create_time(self, val: u64) -> Self
Builder function that sets the Attachment create_time.
Time when the attachment was uploaded as a UNIX timestamp
multiplied by 1000 (matching the format of getTime() in JavaScript).
Changes: Changed in Zulip 3.0 (feature level 22). This field was
previously a floating point number.
Source§impl Attachment
impl Attachment
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Gets the Attachment name.
Name of the uploaded file.
Sourcepub fn set_name<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_name<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the Attachment name.
Name of the uploaded file.
Sourcepub fn unset_name(&mut self) -> Option<String>
pub fn unset_name(&mut self) -> Option<String>
Unsets the Attachment name.
Name of the uploaded file.
Sourcepub fn with_name<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_name<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the Attachment name.
Name of the uploaded file.
Sourcepub fn path_id(&self) -> Option<&str>
pub fn path_id(&self) -> Option<&str>
Gets the Attachment path_id.
A representation of the path of the file within the
repository of user-uploaded files. If the path_id of a
file is {realm_id}/ab/cdef/temp_file.py, its URL will be:
{server_url}/user_uploads/{realm_id}/ab/cdef/temp_file.py.
Sourcepub fn set_path_id<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_path_id<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the Attachment path_id.
A representation of the path of the file within the
repository of user-uploaded files. If the path_id of a
file is {realm_id}/ab/cdef/temp_file.py, its URL will be:
{server_url}/user_uploads/{realm_id}/ab/cdef/temp_file.py.
Sourcepub fn unset_path_id(&mut self) -> Option<String>
pub fn unset_path_id(&mut self) -> Option<String>
Unsets the Attachment path_id.
A representation of the path of the file within the
repository of user-uploaded files. If the path_id of a
file is {realm_id}/ab/cdef/temp_file.py, its URL will be:
{server_url}/user_uploads/{realm_id}/ab/cdef/temp_file.py.
Sourcepub fn with_path_id<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_path_id<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the Attachment path_id.
A representation of the path of the file within the
repository of user-uploaded files. If the path_id of a
file is {realm_id}/ab/cdef/temp_file.py, its URL will be:
{server_url}/user_uploads/{realm_id}/ab/cdef/temp_file.py.
Sourcepub fn messages(&self) -> Option<&[AttachmentMessage]>
pub fn messages(&self) -> Option<&[AttachmentMessage]>
Gets the Attachment messages.
Contains basic details on any Zulip messages that have been
sent referencing this uploaded file.
This includes messages sent by any user in the Zulip
organization who sent a message containing a link to the
uploaded file.
Sourcepub fn set_messages<'a, C: Into<Cow<'a, [AttachmentMessage]>>>(
&mut self,
val: C,
)
pub fn set_messages<'a, C: Into<Cow<'a, [AttachmentMessage]>>>( &mut self, val: C, )
Sets the Attachment messages.
Contains basic details on any Zulip messages that have been
sent referencing this uploaded file.
This includes messages sent by any user in the Zulip
organization who sent a message containing a link to the
uploaded file.
Sourcepub fn unset_messages(&mut self) -> Option<Vec<AttachmentMessage>>
pub fn unset_messages(&mut self) -> Option<Vec<AttachmentMessage>>
Unsets the Attachment messages.
Contains basic details on any Zulip messages that have been
sent referencing this uploaded file.
This includes messages sent by any user in the Zulip
organization who sent a message containing a link to the
uploaded file.
Sourcepub fn with_messages<'a, C: Into<Cow<'a, [AttachmentMessage]>>>(
self,
val: C,
) -> Self
pub fn with_messages<'a, C: Into<Cow<'a, [AttachmentMessage]>>>( self, val: C, ) -> Self
Builder function that sets the Attachment messages.
Contains basic details on any Zulip messages that have been
sent referencing this uploaded file.
This includes messages sent by any user in the Zulip
organization who sent a message containing a link to the
uploaded file.
Trait Implementations§
Source§impl Clone for Attachment
impl Clone for Attachment
Source§impl Debug for Attachment
impl Debug for Attachment
Source§impl Default for Attachment
impl Default for Attachment
Source§impl<'de> Deserialize<'de> for Attachment
impl<'de> Deserialize<'de> for Attachment
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>,
Source§impl Display for Attachment
impl Display for Attachment
impl Eq for Attachment
Source§impl PartialEq for Attachment
impl PartialEq for Attachment
Source§impl Serialize for Attachment
impl Serialize for Attachment
impl StructuralPartialEq for Attachment
Auto Trait Implementations§
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnsafeUnpin for Attachment
impl UnwindSafe for Attachment
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.