Skip to content

Repository files navigation

easy_example

  • rust base frame:log , config ,network,zeromq ,mqtt,web,rpc ,base64
  • dds: iceoryx2

crate

namereplacefunnote
tokioasync task ,tcp ,udp,channel,async frame,tokio::spawn
configyaml,toml,json,single fileread config files ,and put into struct datasimplize config function
tracinglog4rs,env_loggerasync log with file
tmqzeromq with tokio
once_celllazy_staticglobal reference from config file
rumqttcpaho-mqttmqtt of rust with tokio
tokio-serialserialasync serial port
base64base64encode decode
plotplotlyplot data all you wantplot to web,easy than plotters,(https://github.com/youngday/easy_wasm_plotly)
iceoryx2ddspubsub dds ipc for rosnew realtime(10us) ipc
poem_grpctonic grpcput ./proto build.rs files same as cargo.toml path
axum websocketwebsocketaxum example ,tokio-tungstenite
quinn quicquichewebtransport

examples

namefunnote
tcp-client,tcp-servertcp client server
posthttp client postwith dynamic json
zeromq-tmqget udp,http data to zeromq
zmq_pub,zmq_subtmq ,zeromq lib, publish,subscriber
udp-client,udp-serverudp client,server
channel-mpscmulti productor,single consummer queuempsc,for mpmc ,see flume,async-channel
mqttdmqtt brokermqtt with tokio , run mqtt broker ,before run client , cargo run --release --example rumqttd -- -c rumqttd.toml -vvv
mqtt-asyncpubsubmqtt clientmqtt with tokio , run mqtt broker ,before run client
serial-printasync serial port
base64base64encode decode
plotplot datahttps://github.com/youngday/easy_wasm_plotly
ice_pub,ice_subpub subpub sub
discoveryiceoryx2 discovery
grpc-client,grpc-server,grpc-jsoncodec-serverpoem grpc examples ,with json codec⚠️ grpc branch
ws_client,ws_serverwebsocket
wt_server,wt_clientwebtransportreplace websocket with http3/quic

vscode build

https://code.visualstudio.com/docs/languages/rust

dds

target

zeromq is a good dds rpc, but rust zmq is maintained slowly. we could have more fast dds selection,and it can bind to ros.

iceoryx2

pub and sub ,test ok

grpc

for building proto not work on github workflow,

⚠️ // please uncomment for grpc

mqtt

mqtt update to v5 protocol

cargo run --example rumqttd

pub and sub

cargo run --example mqtt_asyncpubsub
cargo run --release --example rumqttd -- -c rumqttd.toml -vvv 

or ./rumqtt.sh

webtransport

please check examples/webtransport/src/README.md and

  • Generate a certificate:
./cert/generate
  • Run the Rust server:
cargo run --example wt_server -- --tls-cert cert/localhost.crt --tls-key cert/localhost.key
  • Run the Rust client:
cargo run --example wt_client -- --tls-cert cert/localhost.crt
  • Run a Web client:
cd web; npm install; npx parcel serve client.html --open

examples

base64
discovery
ice_pub
ice_sub
load_csv
mpsc_tokio
mqtt_asyncpubsub
post
rumqttd
serial_print
tcp_client
tcp_server
udp_client
udp_echo
ws_client
ws_server
wt_client
wt_server
zeromq_tmq
zmq_pub
zmq_sub

About

collect some useful examples, please give me some advice

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages