pub struct TrailingDetailsOwnedView(/* private fields */);Expand description
Self-contained, 'static owned view of a TrailingDetails message.
Wraps ::buffa::OwnedView<TrailingDetailsView<'static>>: the decoded view and the ::buffa::bytes::Bytes buffer it borrows from travel together, so the handle is 'static and Send + Sync — suitable for async handlers, spawned tasks, and anywhere a 'static bound is required.
Field accessors return borrows tied to &self. Use Self::view to get the full TrailingDetailsView when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.
Implementations§
Source§impl TrailingDetailsOwnedView
impl TrailingDetailsOwnedView
Sourcepub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
pub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
Decode an owned view from a ::buffa::bytes::Bytes buffer.
The view borrows directly from the buffer’s data; the buffer is retained inside the returned handle.
§Errors
Returns ::buffa::DecodeError if the buffer contains invalid
protobuf data.
Sourcepub fn decode_with_options(
bytes: Bytes,
opts: &DecodeOptions,
) -> Result<Self, DecodeError>
pub fn decode_with_options( bytes: Bytes, opts: &DecodeOptions, ) -> Result<Self, DecodeError>
Decode with custom ::buffa::DecodeOptions (recursion limit,
max message size).
§Errors
Returns ::buffa::DecodeError if the buffer is invalid or
exceeds the configured limits.
Sourcepub fn from_owned(msg: &TrailingDetails) -> Result<Self, DecodeError>
pub fn from_owned(msg: &TrailingDetails) -> Result<Self, DecodeError>
Build from an owned message via an encode → decode round-trip.
§Errors
Returns ::buffa::DecodeError if the re-encoded bytes are
somehow invalid (should not happen for well-formed messages).
Sourcepub fn view(&self) -> &TrailingDetailsView<'_>
pub fn view(&self) -> &TrailingDetailsView<'_>
Borrow the full TrailingDetailsView with its lifetime tied to &self.
Sourcepub fn to_owned_message(&self) -> Result<TrailingDetails, DecodeError>
pub fn to_owned_message(&self) -> Result<TrailingDetails, DecodeError>
Convert to the owned message type.
§Errors
Returns an error if re-materializing preserved unknown fields fails (e.g. the unknown-field limit is exceeded).
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consume the handle, returning the underlying bytes buffer.
Sourcepub fn trailing_distance_ticks(&self) -> i64
pub fn trailing_distance_ticks(&self) -> i64
Trailing distance as a price delta in 1e-6 quote-unit ticks.
Field 1: trailing_distance_ticks
Sourcepub fn activation_price_ticks(&self) -> i64
pub fn activation_price_ticks(&self) -> i64
Optional activation price: trailing only starts after this price is reached. Expressed in quote units scaled by 1e6.
Field 2: activation_price_ticks
Sourcepub fn peak_price_ticks(&self) -> i64
pub fn peak_price_ticks(&self) -> i64
Current peak price in quote units scaled by 1e6 for sell trailing stops.
Field 3: peak_price_ticks
Sourcepub fn trough_price_ticks(&self) -> i64
pub fn trough_price_ticks(&self) -> i64
Current trough price in quote units scaled by 1e6 for buy trailing stops.
Field 4: trough_price_ticks
Sourcepub fn trailing_distance_bps(&self) -> i32
pub fn trailing_distance_bps(&self) -> i32
Trailing distance in basis points (1 bp = 0.01%).
Field 5: trailing_distance_bps
Sourcepub fn max_slippage_ticks(&self) -> i32
pub fn max_slippage_ticks(&self) -> i32
Optional maximum allowed slippage as a price delta in 1e-6 quote-unit ticks.
Field 6: max_slippage_ticks
Sourcepub fn max_slippage_bps(&self) -> i32
pub fn max_slippage_bps(&self) -> i32
Optional maximum allowed slippage in basis points (1 bp = 0.01%).
Field 7: max_slippage_bps
Sourcepub fn trigger_price_source(&self) -> EnumValue<TriggerPriceSource>
pub fn trigger_price_source(&self) -> EnumValue<TriggerPriceSource>
Price source used for trigger evaluation. Fixed for the lifetime of the trigger and exposed for completeness.
Field 8: trigger_price_source
Sourcepub fn trigger_direction(&self) -> EnumValue<TriggerDirection>
pub fn trigger_direction(&self) -> EnumValue<TriggerDirection>
Direction the price must cross to fire the trigger. Fixed for the lifetime of the trigger and exposed for completeness.
Field 9: trigger_direction
Trait Implementations§
Source§impl AsRef<OwnedView<TrailingDetailsView<'static>>> for TrailingDetailsOwnedView
impl AsRef<OwnedView<TrailingDetailsView<'static>>> for TrailingDetailsOwnedView
Source§fn as_ref(&self) -> &OwnedView<TrailingDetailsView<'static>>
fn as_ref(&self) -> &OwnedView<TrailingDetailsView<'static>>
Source§impl Clone for TrailingDetailsOwnedView
impl Clone for TrailingDetailsOwnedView
Source§fn clone(&self) -> TrailingDetailsOwnedView
fn clone(&self) -> TrailingDetailsOwnedView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more