pub struct File {
pub identifier: ObjectIdentifier,
pub object_name: String,
pub file_type: String,
pub file_size: u32,
pub modification_date: Date,
pub archive: bool,
pub read_only: bool,
pub file_access_method: FileAccessMethod,
pub record_count: Option<u32>,
pub description: String,
pub file_data: Vec<u8>,
}Expand description
File object implementation
Fields§
§identifier: ObjectIdentifierObject identifier
object_name: StringObject name
file_type: StringFile type (MIME type or file extension)
file_size: u32File size in octets
modification_date: DateModification date (BACnet Date format)
archive: boolArchive flag
read_only: boolRead only flag
file_access_method: FileAccessMethodFile access method
record_count: Option<u32>Record count (for record access method)
description: StringDescription
file_data: Vec<u8>File contents (in-memory storage for this implementation)
Implementations§
Source§impl File
impl File
Sourcepub fn new(instance: u32, object_name: String, file_type: String) -> Self
pub fn new(instance: u32, object_name: String, file_type: String) -> Self
Create a new File object
Sourcepub fn set_file_data(&mut self, data: Vec<u8>)
pub fn set_file_data(&mut self, data: Vec<u8>)
Set file contents
Sourcepub fn get_file_data(&self) -> &[u8] ⓘ
pub fn get_file_data(&self) -> &[u8] ⓘ
Get file contents
Sourcepub fn read_data(
&self,
start_position: u32,
requested_count: u32,
) -> Result<Vec<u8>>
pub fn read_data( &self, start_position: u32, requested_count: u32, ) -> Result<Vec<u8>>
Read data from file at specified position
Sourcepub fn write_data(&mut self, start_position: u32, data: &[u8]) -> Result<()>
pub fn write_data(&mut self, start_position: u32, data: &[u8]) -> Result<()>
Write data to file at specified position
Trait Implementations§
Source§impl BacnetObject for File
impl BacnetObject for File
Source§fn identifier(&self) -> ObjectIdentifier
fn identifier(&self) -> ObjectIdentifier
Get the object identifier
Source§fn get_property(&self, property: PropertyIdentifier) -> Result<PropertyValue>
fn get_property(&self, property: PropertyIdentifier) -> Result<PropertyValue>
Get a property value
Source§fn set_property(
&mut self,
property: PropertyIdentifier,
value: PropertyValue,
) -> Result<()>
fn set_property( &mut self, property: PropertyIdentifier, value: PropertyValue, ) -> Result<()>
Set a property value
Source§fn is_property_writable(&self, property: PropertyIdentifier) -> bool
fn is_property_writable(&self, property: PropertyIdentifier) -> bool
Check if property is writable
Source§fn property_list(&self) -> Vec<PropertyIdentifier>
fn property_list(&self) -> Vec<PropertyIdentifier>
Get list of all properties
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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