Open SAdams601 opened 2 months ago
To solve your immediate problem, if you import SdkError
from aws_sdk_eventbridge::error::SdkError
, it should have the generic already set: https://docs.rs/aws-sdk-eventbridge/latest/aws_sdk_eventbridge/error/type.SdkError.html
I returning the result of the send
call from a function so I need to reference the type in the return type of that function.
Yes. It's defaulted in the SdkError
type that is re-exported in aws-sdk-eventbridge, so you don't actually need to reference it.
The solution which @jdisanti proposed is fine if one needs to use SdkError
in a type annotation, but it does not help when one is looking to construct an instance of the type. My use case, for instance, requires me to do so to produce a fake return value in a test, without the complexity of the recommended solution to mock such a value.
SdkError
and it's constructor functions are public. You should be able to use them to create an instance.
Can that approach be used to construct variants with the raw
component (i.e the R
type parameter), where that component is the same type used by the SDK (ex. HttpResponse)? It seems like that not is possible without importing aws-smithy-runtime-api
, since those raw
types are not re-exported by the service-level packages (in my case, it was aws-sdk-s3
).
aws_sdk_eventbridge::operation::put_events::builders::PutEventsFluentBuilder::send
returns aResult<PutEventsOutput, SdkError<PutEventsError, HttpResponse>>
butHttpResponse
is not available without adding theaws-smithy-runtime-api
crate as a dependency.