Skip to main content

ObjectInfo

Struct ObjectInfo 

Source
pub struct ObjectInfo {
Show 20 fields pub handle: ObjectHandle, pub storage_id: StorageId, pub format: ObjectFormatCode, pub protection_status: ProtectionStatus, pub size: u64, pub thumb_format: ObjectFormatCode, pub thumb_size: u32, pub thumb_width: u32, pub thumb_height: u32, pub image_width: u32, pub image_height: u32, pub image_bit_depth: u32, pub parent: ObjectHandle, pub association_type: AssociationType, pub association_desc: u32, pub sequence_number: u32, pub filename: String, pub created: Option<DateTime>, pub modified: Option<DateTime>, pub keywords: String,
}
Expand description

Object information returned by GetObjectInfo.

Contains file/folder metadata including name, size, timestamps, and hierarchy info.

Fields§

§handle: ObjectHandle

Object handle (set after parsing, not part of protocol data).

§storage_id: StorageId

Storage containing this object.

§format: ObjectFormatCode

Object format code.

§protection_status: ProtectionStatus

Protection status.

§size: u64

Object size in bytes.

Note: Protocol uses u32, but we store as u64. Values of 0xFFFFFFFF indicate the object is larger than 4GB (use GetObjectPropValue for actual size).

§thumb_format: ObjectFormatCode

Thumbnail format.

§thumb_size: u32

Thumbnail size in bytes.

§thumb_width: u32

Thumbnail width in pixels.

§thumb_height: u32

Thumbnail height in pixels.

§image_width: u32

Image width in pixels.

§image_height: u32

Image height in pixels.

§image_bit_depth: u32

Image bit depth.

§parent: ObjectHandle

Parent object handle (ROOT for root-level objects).

§association_type: AssociationType

Association type (folder type).

§association_desc: u32

Association description.

§sequence_number: u32

Sequence number.

§filename: String

Filename.

§created: Option<DateTime>

Creation timestamp.

§modified: Option<DateTime>

Modification timestamp.

§keywords: String

Keywords string.

Implementations§

Source§

impl ObjectInfo

Source

pub fn from_bytes(buf: &[u8]) -> Result<Self, Error>

Parse ObjectInfo from a byte buffer.

The buffer should contain the ObjectInfo dataset as returned by GetObjectInfo.

Source

pub fn to_bytes(&self) -> Result<Vec<u8>, Error>

Serialize ObjectInfo to a byte buffer.

Used for SendObjectInfo operation.

Returns an error if the created or modified DateTime contains invalid values.

Source

pub fn is_folder(&self) -> bool

Check if this object is a folder.

Returns true if the format is Association or the association type is GenericFolder.

Source

pub fn is_file(&self) -> bool

Check if this object is a file.

Returns true if this is not a folder.

Trait Implementations§

Source§

impl Clone for ObjectInfo

Source§

fn clone(&self) -> ObjectInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObjectInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ObjectInfo

Source§

fn default() -> ObjectInfo

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.