in codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/StreamingTraitSymbolProvider.kt [28:48]
override fun toSymbol(shape: Shape): Symbol {
val initial = base.toSymbol(shape)
// We are only targetting member shapes
if (shape !is MemberShape) {
return initial
}
val target = model.expectShape(shape.target)
val container = model.expectShape(shape.container)
// We are only targeting output shapes
if (!(container.hasTrait<SyntheticOutputTrait>() || container.hasTrait<SyntheticInputTrait>())) {
return initial
}
// We are only targeting streaming blobs
return if (target is BlobShape && shape.isStreaming(model)) {
RuntimeType.byteStream(config().runtimeConfig).toSymbol().toBuilder().setDefault(Default.RustDefault).build()
} else {
base.toSymbol(shape)
}
}