Skip to content

Make ProcessCallbacks struct public - #224

Open
Davvos11 wants to merge 1 commit into
RustAudio:mainfrom
Davvos11:main
Open

Make ProcessCallbacks struct public#224
Davvos11 wants to merge 1 commit into
RustAudio:mainfrom
Davvos11:main

Conversation

@Davvos11

Copy link
Copy Markdown

Changes:

Made ProcessCallbacks public in lib.rs.

Why?

When creating an AsyncClient using client.activate_async and using a handler with state, the ProcessCallbacks type is needed if you want to annotate the type of the AsyncClient

For example:

fnsome_function() -> anyhow::Result<AsyncClient<Notifications,ClosureProcessHandler<State,ProcessCallbacks<implFnMut(&mutState,&Client,&ProcessScope) -> Control,implFnMut(&mutState,&Client,Frames) -> Control>>>>{let process_callback = move |state:&mutState,client:&Client,ps:&ProcessScope| -> Control{Control::Continue};let buffer_callback = |state:&mutState,client:&Client,len:Frames| -> Control{Control::Continue};let handler = ClosureProcessHandler::with_state(Jack::default(), process_callback, buffer_callback);let active_client = client.activate_async(notifications, handler)?;Ok(active_client)}

@Davvos11

Copy link
Copy Markdown
Author

I found that I can also type the client using impl ProcessHandler to avoid this issue:

fn some_function() -> anyhow::Result<AsyncClient<Notifications,implProcessHandler>{

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Davvos11