Module: Codify::Rust::Type
- Included in:
- Definition, Codify::Rust::Types::Named, Codify::Rust::Types::Option, Codify::Rust::Types::Ref, Codify::Rust::Types::Result, Codify::Rust::Types::Tuple0, Codify::Rust::Types::Val, Codify::Rust::Types::Vec
- Defined in:
- lib/codify/rust/type.rb
Instance Method Summary collapse
- #defaultible? ⇒ Boolean
- #definition? ⇒ Boolean
- #each_subtype(&block) ⇒ void
- #primitive? ⇒ Boolean
- #to_rust ⇒ Object
- #types ⇒ Array<Type>
Instance Method Details
#defaultible? ⇒ Boolean
19 20 21 |
# File 'lib/codify/rust/type.rb', line 19 def defaultible? self.primitive? end |
#definition? ⇒ Boolean
23 24 25 |
# File 'lib/codify/rust/type.rb', line 23 def definition? Codify::Rust::Definition === self end |
#each_subtype(&block) ⇒ void
This method returns an undefined value.
35 36 37 38 39 40 41 |
# File 'lib/codify/rust/type.rb', line 35 def each_subtype(&block) self.types.each do |subtype| raise RuntimeError, subtype.inspect unless subtype.is_a?(Codify::Rust::Type) block.call(subtype) if block_given? subtype.each_subtype(&block) end end |
#primitive? ⇒ Boolean
13 14 15 |
# File 'lib/codify/rust/type.rb', line 13 def primitive? true end |
#to_rust ⇒ Object
7 8 9 |
# File 'lib/codify/rust/type.rb', line 7 def to_rust self end |