Note: This document covers API impact only. For more details, see the ABI compatibility page
- | init | step 1 | step 2 | step 3 | step 4 |
---|---|---|---|---|---|
fidl | link | link | link | ||
dart | link | link | |||
go | link | link | link | ||
hlcpp | link | link | |||
llcpp | link | link | |||
rust | link | link | link |
protocol Example { ExistingMethod(); OldMethod(); };
class Server extends fidllib.Example { @override Future<void> existingMethod() async {} @override Future<void> oldMethod() async {} } void client(fidllib.ExampleProxy client) async { await client.existingMethod(); await client.oldMethod(); }
type client struct { removeMethod *lib.ExampleWithCtxInterface } func (c client) test() { c.removeMethod.ExistingMethod(context.Background()) c.removeMethod.OldMethod(context.Background()) } type server struct{} // Assert that server implements the Example interface var _ lib.ExampleWithCtx = &server{} func (*server) ExistingMethod(fidl.Context) error { return nil } func (*server) OldMethod(fidl.Context) error { return nil }
class Server : public fidl_test::Example { void ExistingMethod() final {} void OldMethod() final {} }; void client(fidl_test::ExamplePtr client) { client->ExistingMethod(); client->OldMethod(); }
class Server final : public fidl::WireServer<fidl_test::Example> { public: void ExistingMethod(ExistingMethodRequestView request, ExistingMethodCompleter::Sync& completer) final {} void OldMethod(OldMethodRequestView request, OldMethodCompleter::Sync& completer) final {} }; void client(fidl::WireClient<fidl_test::Example> client) { client->ExistingMethod(); client->OldMethod(); }
struct ExampleFakeProxy; impl fidl_lib::ExampleProxyInterface for ExampleFakeProxy { fn existing_method(&self) -> Result<(), fidl::Error> { Ok(()) } fn old_method(&self) -> Result<(), fidl::Error> { Ok(()) } } async fn example_service(chan: fasync::Channel) -> Result<(), fidl::Error> { let mut stream = fidl_lib::ExampleRequestStream::from_channel(chan); while let Some(req) = stream.try_next().await? { match req { fidl_lib::ExampleRequest::ExistingMethod { .. } => {} fidl_lib::ExampleRequest::OldMethod { .. } => {} } } Ok(()) }
[Transitional]
attribute.protocol Example { ExistingMethod(); + @transitional OldMethod(); };
class Server extends fidllib.Example { @override Future<void> existingMethod() async {} - - @override - Future<void> oldMethod() async {} } void client(fidllib.ExampleProxy client) async { await client.existingMethod(); - await client.oldMethod(); }
WithCtxTransitionBase
struct into the server type.type client struct { removeMethod *lib.ExampleWithCtxInterface } func (c client) test() { c.removeMethod.ExistingMethod(context.Background()) - c.removeMethod.OldMethod(context.Background()) } - type server struct{} + type server struct { + lib.ExampleWithCtxInterface + } // Assert that server implements the Example interface var _ lib.ExampleWithCtx = &server{} func (*server) ExistingMethod(fidl.Context) error { return nil } - func (*server) OldMethod(fidl.Context) error { - return nil - } -
class Server : public fidl_test::Example { void ExistingMethod() final {} - void OldMethod() final {} }; - void client(fidl_test::ExamplePtr client) { - client->ExistingMethod(); - client->OldMethod(); - } + void client(fidl_test::ExamplePtr client) { client->ExistingMethod(); }
class Server final : public fidl::WireServer<fidl_test::Example> { public: void ExistingMethod(ExistingMethodRequestView request, ExistingMethodCompleter::Sync& completer) final {} - void OldMethod(OldMethodRequestView request, OldMethodCompleter::Sync& completer) final {} }; - void client(fidl::WireClient<fidl_test::Example> client) { - client->ExistingMethod(); - client->OldMethod(); - } + void client(fidl::WireClient<fidl_test::Example> client) { client->ExistingMethod(); }
_
) arm.ProxyInterface
).struct ExampleFakeProxy; impl fidl_lib::ExampleProxyInterface for ExampleFakeProxy { fn existing_method(&self) -> Result<(), fidl::Error> { - Ok(()) - } - fn old_method(&self) -> Result<(), fidl::Error> { Ok(()) } } async fn example_service(chan: fasync::Channel) -> Result<(), fidl::Error> { let mut stream = fidl_lib::ExampleRequestStream::from_channel(chan); while let Some(req) = stream.try_next().await? { + #[allow(unreachable_patterns)] match req { fidl_lib::ExampleRequest::ExistingMethod { .. } => {} - fidl_lib::ExampleRequest::OldMethod { .. } => {} + _ => {} } } Ok(()) }
protocol Example { ExistingMethod(); - @transitional - OldMethod(); };
WithCtxInterface
struct.type client struct { removeMethod *lib.ExampleWithCtxInterface } func (c client) test() { c.removeMethod.ExistingMethod(context.Background()) } - type server struct { - lib.ExampleWithCtxInterface - } + type server struct{} // Assert that server implements the Example interface var _ lib.ExampleWithCtx = &server{} func (*server) ExistingMethod(fidl.Context) error { return nil }
#[allow(unreachable_patterns)]
attribute and the catch-all match arm.struct ExampleFakeProxy; impl fidl_lib::ExampleProxyInterface for ExampleFakeProxy { fn existing_method(&self) -> Result<(), fidl::Error> { Ok(()) } } async fn example_service(chan: fasync::Channel) -> Result<(), fidl::Error> { let mut stream = fidl_lib::ExampleRequestStream::from_channel(chan); while let Some(req) = stream.try_next().await? { - #[allow(unreachable_patterns)] match req { fidl_lib::ExampleRequest::ExistingMethod { .. } => {} - _ => {} } } Ok(()) }