pub struct OperationState {
pub sid: u32,
pub ioid: u32,
pub command: u8,
pub pv_name: Option<String>,
pub field_desc: Option<StructureDesc>,
pub initialized: bool,
pub last_seen: Instant,
pub update_times: VecDeque<Instant>,
pub recent_messages: VecDeque<String>,
/* private fields */
}Expand description
State for an active operation (GET/PUT/MONITOR etc.)
Fields§
§sid: u32Server channel ID this operation is on
ioid: u32Operation ID
command: u8Command type (10=GET, 11=PUT, 13=MONITOR, etc.)
pv_name: Option<String>PV name (resolved from channel state)
field_desc: Option<StructureDesc>Field description from INIT response (parsed introspection)
initialized: boolWhether INIT phase completed
last_seen: InstantLast activity
update_times: VecDeque<Instant>§recent_messages: VecDeque<String>Implementations§
Source§impl OperationState
impl OperationState
pub fn new(sid: u32, ioid: u32, command: u8, pv_name: Option<String>) -> Self
pub fn touch(&mut self)
pub fn is_expired(&self, ttl: Duration) -> bool
Sourcepub fn set_field_desc(&mut self, field_desc: Option<StructureDesc>)
pub fn set_field_desc(&mut self, field_desc: Option<StructureDesc>)
Attach introspection and cache its measured size.
Sourcepub fn field_desc_bytes(&self) -> usize
pub fn field_desc_bytes(&self) -> usize
Heap bytes held by this operation’s introspection, if any.
Sourcepub fn is_placeholder(&self) -> bool
pub fn is_placeholder(&self) -> bool
True when this operation was auto-created from mid-stream traffic and carries nothing the decoder can use: no completed INIT, no introspection. Shed first under memory pressure.
Sourcepub fn heap_bytes(&self) -> usize
pub fn heap_bytes(&self) -> usize
Bytes this operation owns on the heap, excluding the struct itself.
Trait Implementations§
Source§impl Clone for OperationState
impl Clone for OperationState
Source§fn clone(&self) -> OperationState
fn clone(&self) -> OperationState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OperationState
impl RefUnwindSafe for OperationState
impl Send for OperationState
impl Sync for OperationState
impl Unpin for OperationState
impl UnsafeUnpin for OperationState
impl UnwindSafe for OperationState
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