错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Optionals and Error Handling

  • Charles Edge,
  • Joel Rennich,
  • Jeremy Bannister

摘要

Optionals are a way to represent the absence of a value. They are used when a value may not always be available. For example, consider an optional to represent things like a user's current location, which may not be available if the user's location services are turned off, or the name of a device or model, frustratingly also not always available to an application.