text: ###############################################################################
  # @generated
  # This file is auto-generated by the cargo-bazel tool.
  #
  # DO NOT MODIFY: Local changes may be replaced in future executions.
  ###############################################################################
  """
  # `crates_repository` API
  
  - [aliases](#aliases)
  - [crate_deps](#crate_deps)
  - [all_crate_deps](#all_crate_deps)
  - [crate_repositories](#crate_repositories)
  
  """
  
  load("@bazel_skylib//lib:selects.bzl", "selects")
  
  ###############################################################################
  # MACROS API
  ###############################################################################
  
  # An identifier that represent common dependencies (unconditional).
  _COMMON_CONDITION = ""
  
  def _flatten_dependency_maps(all_dependency_maps):
      """Flatten a list of dependency maps into one dictionary.
  
      Dependency maps have the following structure:
  
      ```python
      DEPENDENCIES_MAP = {
          # The first key in the map is a Bazel package
          # name of the workspace this file is defined in.
          "workspace_member_package": {
  
              # Not all dependnecies are supported for all platforms.
              # the condition key is the condition required to be true
              # on the host platform.
              "condition": {
  
                  # An alias to a crate target.     # The label of the crate target the
                  # Aliases are only crate names.   # package name refers to.
                  "package_name":                   "@full//:label",
              }
          }
      }
      ```
  
      Args:
          all_dependency_maps (list): A list of dicts as described above
  
      Returns:
          dict: A dictionary as described above
      """
      dependencies = {}
  
      for workspace_deps_map in all_dependency_maps:
          for pkg_name, conditional_deps_map in workspace_deps_map.items():
              if pkg_name not in dependencies:
                  non_frozen_map = dict()
                  for key, values in conditional_deps_map.items():
                      non_frozen_map.update({key: dict(values.items())})
                  dependencies.setdefault(pkg_name, non_frozen_map)
                  continue
  
              for condition, deps_map in conditional_deps_map.items():
                  # If the condition has not been recorded, do so and continue
                  if condition not in dependencies[pkg_name]:
                      dependencies[pkg_name].setdefault(condition, dict(deps_map.items()))
                      continue
  
                  # Alert on any miss-matched dependencies
                  inconsistent_entries = []
                  for crate_name, crate_label in deps_map.items():
                      existing = dependencies[pkg_name][condition].get(crate_name)
                      if existing and existing != crate_label:
                          inconsistent_entries.append((crate_name, existing, crate_label))
                      dependencies[pkg_name][condition].update({crate_name: crate_label})
  
      return dependencies
  
  def crate_deps(deps, package_name = None):
      """Finds the fully qualified label of the requested crates for the package where this macro is called.
  
      Args:
          deps (list): The desired list of crate targets.
          package_name (str, optional): The package name of the set of dependencies to look up.
              Defaults to `native.package_name()`.
  
      Returns:
          list: A list of labels to generated rust targets (str)
      """
  
      if not deps:
          return []
  
      if package_name == None:
          package_name = native.package_name()
  
      # Join both sets of dependencies
      dependencies = _flatten_dependency_maps([
          _NORMAL_DEPENDENCIES,
          _NORMAL_DEV_DEPENDENCIES,
          _PROC_MACRO_DEPENDENCIES,
          _PROC_MACRO_DEV_DEPENDENCIES,
          _BUILD_DEPENDENCIES,
          _BUILD_PROC_MACRO_DEPENDENCIES,
      ]).pop(package_name, {})
  
      # Combine all conditional packages so we can easily index over a flat list
      # TODO: Perhaps this should actually return select statements and maintain
      # the conditionals of the dependencies
      flat_deps = {}
      for deps_set in dependencies.values():
          for crate_name, crate_label in deps_set.items():
              flat_deps.update({crate_name: crate_label})
  
      missing_crates = []
      crate_targets = []
      for crate_target in deps:
          if crate_target not in flat_deps:
              missing_crates.append(crate_target)
          else:
              crate_targets.append(flat_deps[crate_target])
  
      if missing_crates:
          fail("Could not find crates `{}` among dependencies of `{}`. Available dependencies were `{}`".format(
              missing_crates,
              package_name,
              dependencies,
          ))
  
      return crate_targets
  
  def all_crate_deps(
          normal = False,
          normal_dev = False,
          proc_macro = False,
          proc_macro_dev = False,
          build = False,
          build_proc_macro = False,
          package_name = None):
      """Finds the fully qualified label of all requested direct crate dependencies \
      for the package where this macro is called.
  
      If no parameters are set, all normal dependencies are returned. Setting any one flag will
      otherwise impact the contents of the returned list.
  
      Args:
          normal (bool, optional): If True, normal dependencies are included in the
              output list.
          normal_dev (bool, optional): If True, normla dev dependencies will be
              included in the output list..
          proc_macro (bool, optional): If True, proc_macro dependencies are included
              in the output list.
          proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are
              included in the output list.
          build (bool, optional): If True, build dependencies are included
              in the output list.
          build_proc_macro (bool, optional): If True, build proc_macro dependencies are
              included in the output list.
          package_name (str, optional): The package name of the set of dependencies to look up.
              Defaults to `native.package_name()` when unset.
  
      Returns:
          list: A list of labels to generated rust targets (str)
      """
  
      if package_name == None:
          package_name = native.package_name()
  
      # Determine the relevant maps to use
      all_dependency_maps = []
      if normal:
          all_dependency_maps.append(_NORMAL_DEPENDENCIES)
      if normal_dev:
          all_dependency_maps.append(_NORMAL_DEV_DEPENDENCIES)
      if proc_macro:
          all_dependency_maps.append(_PROC_MACRO_DEPENDENCIES)
      if proc_macro_dev:
          all_dependency_maps.append(_PROC_MACRO_DEV_DEPENDENCIES)
      if build:
          all_dependency_maps.append(_BUILD_DEPENDENCIES)
      if build_proc_macro:
          all_dependency_maps.append(_BUILD_PROC_MACRO_DEPENDENCIES)
  
      # Default to always using normal dependencies
      if not all_dependency_maps:
          all_dependency_maps.append(_NORMAL_DEPENDENCIES)
  
      dependencies = _flatten_dependency_maps(all_dependency_maps).pop(package_name, None)
  
      if not dependencies:
          return []
  
      crate_deps = list(dependencies.pop(_COMMON_CONDITION, {}).values())
      for condition, deps in dependencies.items():
          crate_deps += selects.with_or({_CONDITIONS[condition]: deps.values()})
  
      return crate_deps
  
  def aliases(
          normal = False,
          normal_dev = False,
          proc_macro = False,
          proc_macro_dev = False,
          build = False,
          build_proc_macro = False,
          package_name = None):
      """Produces a map of Crate alias names to their original label
  
      If no dependency kinds are specified, `normal` and `proc_macro` are used by default.
      Setting any one flag will otherwise determine the contents of the returned dict.
  
      Args:
          normal (bool, optional): If True, normal dependencies are included in the
              output list.
          normal_dev (bool, optional): If True, normla dev dependencies will be
              included in the output list..
          proc_macro (bool, optional): If True, proc_macro dependencies are included
              in the output list.
          proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are
              included in the output list.
          build (bool, optional): If True, build dependencies are included
              in the output list.
          build_proc_macro (bool, optional): If True, build proc_macro dependencies are
              included in the output list.
          package_name (str, optional): The package name of the set of dependencies to look up.
              Defaults to `native.package_name()` when unset.
  
      Returns:
          dict: The aliases of all associated packages
      """
      if package_name == None:
          package_name = native.package_name()
  
      # Determine the relevant maps to use
      all_aliases_maps = []
      if normal:
          all_aliases_maps.append(_NORMAL_ALIASES)
      if normal_dev:
          all_aliases_maps.append(_NORMAL_DEV_ALIASES)
      if proc_macro:
          all_aliases_maps.append(_PROC_MACRO_ALIASES)
      if proc_macro_dev:
          all_aliases_maps.append(_PROC_MACRO_DEV_ALIASES)
      if build:
          all_aliases_maps.append(_BUILD_ALIASES)
      if build_proc_macro:
          all_aliases_maps.append(_BUILD_PROC_MACRO_ALIASES)
  
      # Default to always using normal aliases
      if not all_aliases_maps:
          all_aliases_maps.append(_NORMAL_ALIASES)
          all_aliases_maps.append(_PROC_MACRO_ALIASES)
  
      aliases = _flatten_dependency_maps(all_aliases_maps).pop(package_name, None)
  
      if not aliases:
          return dict()
  
      common_items = aliases.pop(_COMMON_CONDITION, {}).items()
  
      # If there are only common items in the dictionary, immediately return them
      if not len(aliases.keys()) == 1:
          return dict(common_items)
  
      # Build a single select statement where each conditional has accounted for the
      # common set of aliases.
      crate_aliases = {"//conditions:default": common_items}
      for condition, deps in aliases.items():
          condition_triples = _CONDITIONS[condition]
          if condition_triples in crate_aliases:
              crate_aliases[condition_triples].update(deps)
          else:
              crate_aliases.update({_CONDITIONS[condition]: dict(deps.items() + common_items)})
  
      return selects.with_or(crate_aliases)
  
  ###############################################################################
  # WORKSPACE MEMBER DEPS AND ALIASES
  ###############################################################################
  
  _NORMAL_DEPENDENCIES = {
      "vendor_local_manifests": {
          _COMMON_CONDITION: {
              "tokio": "//vendor_local_manifests/crates/tokio-1.16.1:tokio",
          },
      },
  }
  
  _NORMAL_ALIASES = {
      "vendor_local_manifests": {
          _COMMON_CONDITION: {
          },
      },
  }
  
  _NORMAL_DEV_DEPENDENCIES = {
      "vendor_local_manifests": {
          _COMMON_CONDITION: {
              "tempfile": "//vendor_local_manifests/crates/tempfile-3.3.0:tempfile",
              "tokio-test": "//vendor_local_manifests/crates/tokio-test-0.4.2:tokio_test",
          },
      },
  }
  
  _NORMAL_DEV_ALIASES = {
      "vendor_local_manifests": {
          _COMMON_CONDITION: {
          },
      },
  }
  
  _PROC_MACRO_DEPENDENCIES = {
      "vendor_local_manifests": {
      },
  }
  
  _PROC_MACRO_ALIASES = {
      "vendor_local_manifests": {
      },
  }
  
  _PROC_MACRO_DEV_DEPENDENCIES = {
      "vendor_local_manifests": {
      },
  }
  
  _PROC_MACRO_DEV_ALIASES = {
      "vendor_local_manifests": {
          _COMMON_CONDITION: {
          },
      },
  }
  
  _BUILD_DEPENDENCIES = {
      "vendor_local_manifests": {
      },
  }
  
  _BUILD_ALIASES = {
      "vendor_local_manifests": {
      },
  }
  
  _BUILD_PROC_MACRO_DEPENDENCIES = {
      "vendor_local_manifests": {
      },
  }
  
  _BUILD_PROC_MACRO_ALIASES = {
      "vendor_local_manifests": {
      },
  }
  
  _CONDITIONS = {
      "cfg(all(any(target_arch = \"x86_64\", target_arch = \"aarch64\"), target_os = \"hermit\"))": [],
      "cfg(any(unix, target_os = \"wasi\"))": ["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "s390x-unknown-linux-gnu", "wasm32-wasi", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-linux-android", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu"],
      "cfg(not(windows))": ["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "s390x-unknown-linux-gnu", "wasm32-unknown-unknown", "wasm32-wasi", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-linux-android", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu"],
      "cfg(target_arch = \"wasm32\")": ["wasm32-unknown-unknown", "wasm32-wasi"],
      "cfg(target_os = \"redox\")": [],
      "cfg(unix)": ["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "s390x-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-linux-android", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu"],
      "cfg(windows)": ["i686-pc-windows-msvc", "x86_64-pc-windows-msvc"],
      "i686-pc-windows-gnu": [],
      "x86_64-pc-windows-gnu": [],
  }
  