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

add: new method to initialize IpcConnect #322

Merged
merged 4 commits into from
Mar 15, 2024

Conversation

yash-atreya
Copy link
Member

Motivation

Ref: #321

Solution

Impl new method for IpcConnect.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be some trait bound on new to prevent users from creating IpcConnect instances that don't work. The From bound is good but not quite sufficient

@prestwich
Copy link
Member

prestwich commented Mar 15, 2024

impl<T> IpcConnect<T> {
    pub fn new(inner: T) -> Self
    where
        Self: alloy_pubsub::PubSubConnect,
    {
        Self { inner }
    }
}

@yash-atreya yash-atreya requested a review from prestwich March 15, 2024 17:15
@prestwich prestwich merged commit 410850b into alloy-rs:main Mar 15, 2024
16 checks passed
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

Successfully merging this pull request may close these issues.

2 participants