| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // This builds the version of the implementations after the change is completed against a specified FIDL library. |
| macro_rules! after_impl { |
| ($name:ident, $fidl_library:ident) => { |
| struct $name(); |
| impl $name { |
| async fn add_method_service(chan: fasync::Channel) -> Result<(), fidl::Error> { |
| let mut stream = $fidl_library::AddMethodRequestStream::from_channel(chan); |
| while let Some(req) = await!(stream.try_next())? { |
| match req { |
| $fidl_library::AddMethodRequest::ExistingMethod { .. } => {} |
| $fidl_library::AddMethodRequest::NewMethod { .. } => {} |
| } |
| } |
| Ok(()) |
| } |
| |
| async fn remove_method_service(chan: fasync::Channel) -> Result<(), fidl::Error> { |
| let mut stream = $fidl_library::RemoveMethodRequestStream::from_channel(chan); |
| while let Some(req) = await!(stream.try_next())? { |
| match req { |
| $fidl_library::RemoveMethodRequest::ExistingMethod { .. } => {} |
| } |
| } |
| Ok(()) |
| } |
| |
| async fn add_event_service(chan: fasync::Channel) -> Result<(), fidl::Error> { |
| let mut stream = $fidl_library::AddEventRequestStream::from_channel(chan); |
| while let Some(req) = await!(stream.try_next())? { |
| match req { |
| $fidl_library::AddEventRequest::ExistingMethod { .. } => {} |
| } |
| } |
| Ok(()) |
| } |
| |
| async fn remove_event_service(chan: fasync::Channel) -> Result<(), fidl::Error> { |
| let mut stream = $fidl_library::RemoveEventRequestStream::from_channel(chan); |
| while let Some(req) = await!(stream.try_next())? { |
| match req { |
| $fidl_library::RemoveEventRequest::ExistingMethod { .. } => {} |
| } |
| } |
| Ok(()) |
| } |
| } |
| }; |
| } |