Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: Examples for the interceptor documentation do not compile #7052

Closed
DavidSouther opened this issue Nov 11, 2024 · 4 comments
Closed

Rust: Examples for the interceptor documentation do not compile #7052

DavidSouther opened this issue Nov 11, 2024 · 4 comments
Assignees

Comments

@DavidSouther
Copy link
Contributor

See awslabs/aws-sdk-rust#1212


MathieuDuponchelle:

I am trying to make use of the interceptor API.

The example in the documentation @ https://docs.rs/aws-sdk-transcribestreaming/latest/aws_sdk_transcribestreaming/config/struct.Builder.html#method.interceptor does not compile.

Once I do get it to compile, I'm also only getting my read_before_deserialization() implementation called once:

  #[derive(Debug)] 
  struct MyInterceptor {                                                                                                       
  }       
                                                                                                                               
  impl Intercept for MyInterceptor {                                                                                           
      fn name(&self) -> &'static str {                                                                                         
          "transcriber-stream"                                                                                                 
      }                                                                                                                        
  
      fn read_before_deserialization(&self,                                                                                    
          _context: &BeforeDeserializationInterceptorContextRef<'_>,                                                           
          _runtime_components: &RuntimeComponents, _cfg: &mut ConfigBag,) -> Result<(), Box<dyn core::error::Error + Send + Sync>> {      
          eprintln!("Here");
       
          Ok(())
      }
  } 

// ...

              let my_interceptor = MyInterceptor {};
              let builder = aws_transcribe::config::Builder::from(aws_config)
                  .interceptor(my_interceptor);
              aws_transcribe::Client::from_conf(builder.build())

Links
https://docs.rs/aws-sdk-transcribestreaming/latest/aws_sdk_transcribestreaming/config/struct.Builder.html#method.interceptor

@MathieuDuponchelle
Copy link

I don't understand why this was opened then closed, the code in the transcribe streaming documentation still does not compile :)

@DavidSouther
Copy link
Contributor Author

DavidSouther commented Nov 11, 2024

That example comes from the SDK generator, and is tracked in the smithy-rs project. It was opened because we thought it was here, then closed as "issue in the wrong repo". The original issue you opened is still open and awaiting a fix in the generator!

@MathieuDuponchelle
Copy link

Ah I see, my bad :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants