Struct DlogutilState

Source
pub struct DlogutilState { /* private fields */ }
Expand description

A struct containing the state of a log handling request.

Implementations§

Source§

impl DlogutilState

Source

pub fn create(config: DlogutilConfig) -> Result<Self>

Finalizes the config into a state struct by connecting to buffers.

An application having platform privilege level can read platform log data by declaring http://tizen.org/privilege/log.

§Returns
  • Ok(Self) - A handle to the state struct.
  • Err(std::io::Error) - An error.
§Errors
Source

pub fn get_log(&mut self, timeout: Option<Duration>) -> Result<DlogutilEntry>

Retrieves a single log according to a dump request.

Returns a returned log as a DlogutilEntry struct.

If the calling process doesn’t have CAP_SYSLOG and is not in the log group, you will only get some of the logs. Also, you must set the mode (DlogutilConfig::mode_set_*).

§Arguments
  • timeout - How many miliseconds to wait for the log. The actual runtime of the call can obviously be slightly longer than this argument. 0 means don’t wait, None means wait indefinitely.
§Returns
  • Ok(DlogutilEntry) - A returned log.
  • Err(std::io::Error) - An error.
§Errors
Source

pub fn buffer_clear(&mut self, buffer: BufferId) -> Result<()>

Irreversibly clears a log buffer from any logs inside.

Either CAP_SYSLOG or being in the log group is required. Also, you can’t use one of the log-getting modes (DlogutilConfig::mode_set_*).

§Errors
Source

pub fn buffer_get_capacity(&mut self, buffer: BufferId) -> Result<u32>

Gets the data storage capacity of a log buffer in bytes.

Either CAP_SYSLOG or being in the log group is required. Also, you can’t use one of the log-getting modes (DlogutilConfig::mode_set_*).

§Returns
  • Ok(u32) - The buffer’s maximum capacity in bytes.
  • Err(std::io::Error) - An error.
§Errors
Source

pub fn buffer_get_usage(&mut self, buffer: BufferId) -> Result<u32>

Gets the storage data usage of a log buffer in bytes.

Either CAP_SYSLOG or being in the log group is required. Also, you can’t use one of the log-getting modes (DlogutilConfig::mode_set_*).

§Returns
  • Ok(u32) - Buffer’s current usage in bytes.
  • Err(std::io::Error) - An error.
§Errors
Source

pub fn buffer_get_alias(&self, buffer: BufferId) -> Result<BufferId>

Gets the buffer aliasing (same storage) information.

Sometimes, multiple buffers will be backed by a single log storage (for example, by the same kernel device). In such cases, the storage will only be opened once. This function allows you to see whether this is the case.

§Returns
  • Ok(BufferId) - Buffer aliasing information.
  • Err(std::io::Error) - An error.
§Errors

Trait Implementations§

Source§

impl Drop for DlogutilState

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for DlogutilState

Source§

impl Sync for DlogutilState

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> 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, 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.