Add no_std test example and update alloc gating

Update codegen to make `bytes` imports conditional on the `alloc`
feature and add a test example for the `thumbv7em-none-eabihf`
target.
This commit is contained in:
2026-05-18 08:43:22 -07:00
parent fa4d8cca83
commit 6910f11d69
9 changed files with 770 additions and 25 deletions
+1
View File
@@ -12,6 +12,7 @@ http-body = "1.0"
http-body-util = "0.1"
tower = "0.4"
futures-util = "0.3"
async-trait = "0.1"
tokio-stream = { version = "0.1", features = ["net"] }
tokio = { version = "1.38", features = ["full"] }
http = "1.1"
+7 -8
View File
@@ -5,18 +5,16 @@ use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint,
use std::str;
use bytes::{Bytes, BytesMut, Buf, BufMut};
use tonic::{Request, Response, Status};
use tokio_stream::Stream;
use std::pin::Pin;
use std::sync::Arc;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::future::Future;
use tonic::body::BoxBody;
use tower::Service;
use futures_util::StreamExt;
use http_body_util::BodyExt;
use http_body::Body;
use tonic::body::BoxBody;
use tokio_stream::Stream;
use crate::{BufferPool, StatusBody};
use async_trait::async_trait;
use http_body_util::BodyExt;
pub struct UnaryRequest<'a> {
accessor: roto_runtime::ProtoAccessor<'a>,
@@ -406,7 +404,8 @@ impl roto_runtime::RotoMessage for OwnedStreamingResponse {
}
}
#[tonic::async_trait]
#[async_trait]
pub trait InteropService: Send + Sync + 'static {
async fn unary_call(&self, request: Request<OwnedUnaryRequest>) -> std::result::Result<Response<OwnedUnaryResponse>, Status>;
async fn streaming_call(&self, request: Request<OwnedStreamingRequest>) -> std::result::Result<Response<Pin<Box<dyn Stream<Item = std::result::Result<OwnedStreamingResponse, Status>> + Send>>>, Status>;