Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: mojom/generators/rust/templates/source.tmpl.go

Issue 2222823002: Rust: Add validation support to code generator (Closed) Base URL: git@github.com:domokit/mojo.git@decoding-test
Patch Set: Double check before land Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package templates 5 package templates
6 6
7 const GenerateSourceFile = ` 7 const GenerateSourceFile = `
8 {{- define "GenerateSourceFile" -}} 8 {{- define "GenerateSourceFile" -}}
9 //! This file was auto-generated by the Rust bindings generator. 9 //! This file was auto-generated by the Rust bindings generator.
10 #![allow(bad_style)] 10 #![allow(bad_style)]
11 #![allow(unused_imports)] 11 #![allow(unused_imports)]
12 #![allow(unused_variables)] 12 #![allow(unused_variables)]
13 #![allow(dead_code)] 13 #![allow(dead_code)]
14 14
15 use mojo::bindings::decoding::Decoder; 15 use mojo::bindings::decoding;
16 use mojo::bindings::decoding::{Decoder, ValidationError};
16 use mojo::bindings::encoding; 17 use mojo::bindings::encoding;
17 use mojo::bindings::encoding::{Context, DataHeaderValue, DATA_HEADER_SIZE, Encod er}; 18 use mojo::bindings::encoding::{Context, DataHeaderValue, DATA_HEADER_SIZE, Encod er};
18 use mojo::bindings::message; 19 use mojo::bindings::message;
19 use mojo::bindings::message::MessageHeader; 20 use mojo::bindings::message::MessageHeader;
20 use mojo::bindings::mojom; 21 use mojo::bindings::mojom;
21 use mojo::bindings::mojom::{MojomEncodable, MojomPointer, MojomStruct, 22 use mojo::bindings::mojom::{MojomEncodable, MojomPointer, MojomStruct,
22 MojomUnion, MojomMessage, MojomInterface, 23 MojomUnion, MojomMessage, MojomInterface,
23 MojomInterfaceSend, MojomInterfaceRecv, 24 MojomInterfaceSend, MojomInterfaceRecv,
24 MojomMessageOption, UNION_SIZE}; 25 MojomMessageOption, UNION_SIZE};
25 26
(...skipping 24 matching lines...) Expand all
50 {{template "GenerateEnum" $enum}} 51 {{template "GenerateEnum" $enum}}
51 {{end}} 52 {{end}}
52 53
53 // Interfaces: 54 // Interfaces:
54 {{range $interface := .Interfaces -}} 55 {{range $interface := .Interfaces -}}
55 {{template "GenerateInterface" $interface}} 56 {{template "GenerateInterface" $interface}}
56 {{end}} 57 {{end}}
57 58
58 {{end}} 59 {{end}}
59 ` 60 `
OLDNEW
« no previous file with comments | « mojom/generators/rust/templates/interface.tmpl.go ('k') | mojom/generators/rust/templates/struct.tmpl.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698