Enum CrateType

    • Method Detail

      • values

        public static CrateType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CrateType c : CrateType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CrateType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getFlavor

        public Flavor getFlavor()
      • isNative

        public boolean isNative()
        Return true if this crate type is intended to be a native output (ie, not intended for further processing by the Rust toolchain). In other words, a binary, or a native-linkable shared or static object.
        Returns:
        Is natively usable.
      • needAllDeps

        public boolean needAllDeps()
        Linking this crate needs all the dependencies available.
        Returns:
        Need all deps.
      • isDynamic

        public boolean isDynamic()
        Crate dynamically links with its dependents.
        Returns:
        Is dynamic.
      • isPic

        public boolean isPic()
        Crate needs to be compiled with relocation-model=pic. Executables are currently always compiled with -pie, and so are also PIC.
        Returns:
        Needs PIC.
      • isExecutable

        public boolean isExecutable()
        Create generates an executable
      • isCheck

        public boolean isCheck()
        We're just checking the code, and generating metadata to allow dependents to check. For libraries this means we emit a metadata file, and binaries produce no output (they just consume library metadata). "save-analysis" also builds in check mode, but we're only concerned about the analysis output.
      • isSaveAnalysis

        public boolean isSaveAnalysis()
        Save-analysis is a more detailed version of check, which saves full type and other information in a json file for consumption by other tools (namely RLS).
      • isProcMacro

        public boolean isProcMacro()
        Return true if this is generating a compiler plugin - ie, it should be linked with a different linker and linker flags.
      • filenameFor

        public String filenameFor​(BuildTarget target,
                                  String name,
                                  CxxPlatform cxxPlatform)
        Return an appropriate filename for this crate, given its type and the platform.
        Parameters:
        name - Base filename
        cxxPlatform - Platform we're building for
        Returns:
        Path component