Functional nanostructures for sensors, optoelectronic devices, and drug delivery