#[repr(C)]pub enum UPriority {
CS0 = 0,
CS1 = 1,
CS2 = 2,
CS3 = 3,
CS4 = 4,
CS5 = 5,
CS6 = 6,
}Expand description
QoS priority classes defined by the uProtocol specification.
Variants§
CS0 = 0
Best effort (lowest priority).
CS1 = 1
Priority class CS1.
CS2 = 2
Priority class CS2.
CS3 = 3
Priority class CS3.
CS4 = 4
Priority class CS4 (streaming).
CS5 = 5
Priority class CS5 (RPC default).
CS6 = 6
Priority class CS6 (highest; network control).
Implementations§
Source§impl UPriority
impl UPriority
Sourcepub fn to_priority_code(self) -> &'static str
pub fn to_priority_code(self) -> &'static str
Encodes this priority to a string.
The encoding of priorities to strings is defined in the uProtocol Core API.
§Examples
use up_rust::UPriority;
assert_eq!(UPriority::CS2.to_priority_code(), "CS2");Sourcepub fn try_from_priority_code<T>(code: T) -> Result<Self, UAttributesError>
pub fn try_from_priority_code<T>(code: T) -> Result<Self, UAttributesError>
Gets the priority for a string.
The encoding of priorities to strings is defined in the uProtocol Core API.
§Errors
Returns an error if the given string does not match a supported priority.
§Examples
use up_rust::UPriority;
let priority = UPriority::try_from_priority_code("CS2").unwrap();
assert_eq!(priority, UPriority::CS2);
assert!(UPriority::try_from_priority_code("not-supported").is_err());Trait Implementations§
Source§impl PartialOrd for UPriority
impl PartialOrd for UPriority
impl Copy for UPriority
impl StructuralPartialEq for UPriority
Auto Trait Implementations§
impl Freeze for UPriority
impl RefUnwindSafe for UPriority
impl Send for UPriority
impl Sync for UPriority
impl Unpin for UPriority
impl UnwindSafe for UPriority
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<TCore> UWithNativePrefixWire for TCore
impl<TCore> UWithNativePrefixWire for TCore
Source§fn into_native_prefix_wire_transport<W>(
self,
wire: W,
) -> UWireTransport<TCore, W, NativePrefixFrameMetadataCodec>where
W: UWire,
fn into_native_prefix_wire_transport<W>(
self,
wire: W,
) -> UWireTransport<TCore, W, NativePrefixFrameMetadataCodec>where
W: UWire,
Wraps this core with an external or custom selected wire using canonical metadata.
Source§fn into_protobuf_transport(
self,
) -> UWireTransport<TCore, ProtobufWire, NativePrefixFrameMetadataCodec>
fn into_protobuf_transport( self, ) -> UWireTransport<TCore, ProtobufWire, NativePrefixFrameMetadataCodec>
Wraps this core with the Protocol Buffers selected-wire profile.
Source§fn into_stable_container_transport(
self,
) -> UWireTransport<TCore, StableContainerWireFormat, NativePrefixFrameMetadataCodec>
fn into_stable_container_transport( self, ) -> UWireTransport<TCore, StableContainerWireFormat, NativePrefixFrameMetadataCodec>
Wraps this core with the stable-container selected-wire profile.