-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rust): add support for external types
- Loading branch information
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package filterrs | ||
|
||
import ( | ||
"github.com/apigear-io/cli/pkg/model" | ||
) | ||
|
||
type RsExtern struct { | ||
Name string | ||
Crate string | ||
Version string | ||
} | ||
|
||
func parseRsExtern(schema *model.Schema) RsExtern { | ||
xe := schema.GetExtern() | ||
return rsExtern(xe) | ||
} | ||
|
||
func rsExtern(xe *model.Extern) RsExtern { | ||
name := xe.Meta.GetString("rs.type") | ||
crate := xe.Meta.GetString("rs.crate") | ||
version := xe.Meta.GetString("rs.version") | ||
if name == "" { | ||
name = xe.Name | ||
} | ||
return RsExtern{ | ||
Name: name, | ||
Crate: crate, | ||
Version: version, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters