pub struct StaticUriProvider { /* private fields */ }Expand description
A URI provider that is statically configured with the uEntity’s authority, entity ID and version.
Implementations§
Source§impl StaticUriProvider
impl StaticUriProvider
Sourcepub fn new(
authority: impl Into<String>,
entity_id: u32,
major_version: u8,
) -> Result<Self, UUriError>
pub fn new( authority: impl Into<String>, entity_id: u32, major_version: u8, ) -> Result<Self, UUriError>
Creates a new URI provider from static information.
§Arguments
authority- The uEntity’s authority name.entity_id- The entity identifier.major_version- The uEntity’s major version.
§Examples
use up_rust::{LocalUriProvider, StaticUriProvider};
let provider = StaticUriProvider::new("my-vehicle", 0x4210, 0x05).unwrap();
assert_eq!(provider.get_authority(), "my-vehicle");Trait Implementations§
Source§impl Debug for StaticUriProvider
impl Debug for StaticUriProvider
Source§impl From<&UUri> for StaticUriProvider
impl From<&UUri> for StaticUriProvider
Source§fn from(source_uri: &UUri) -> Self
fn from(source_uri: &UUri) -> Self
Creates a URI provider from a UUri.
§Arguments
source_uri- The UUri to take the entity’s authority, entity ID and version information from. The UUri’s resource ID is ignored.
§Examples
use up_rust::{LocalUriProvider, StaticUriProvider, UUri};
let source_uri = UUri::try_from("//my-vehicle/4210/5/1000").unwrap();
let provider = StaticUriProvider::from(&source_uri);
assert_eq!(provider.get_authority(), "my-vehicle");
assert_eq!(provider.get_source_uri(), source_uri.clone_with_resource_id(0x0000));Source§impl From<UUri> for StaticUriProvider
impl From<UUri> for StaticUriProvider
Source§impl LocalUriProvider for StaticUriProvider
impl LocalUriProvider for StaticUriProvider
Gets the authority used for URIs representing this uEntity’s resources.
Source§fn get_resource_uri(&self, resource_id: u16) -> UUri
fn get_resource_uri(&self, resource_id: u16) -> UUri
Gets a URI that represents a given resource of this uEntity.
Source§fn get_source_uri(&self) -> UUri
fn get_source_uri(&self) -> UUri
Gets the URI that represents the resource that this uEntity expects
RPC responses and notifications to be sent to.
Auto Trait Implementations§
impl Freeze for StaticUriProvider
impl RefUnwindSafe for StaticUriProvider
impl Send for StaticUriProvider
impl Sync for StaticUriProvider
impl Unpin for StaticUriProvider
impl UnwindSafe for StaticUriProvider
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
§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.